1. SELECT name,sex,old
FROM table
WHERE name LIKE tom
2. = eq
<> ne
>< ><
IN 含む
LIKE =~ %
AND
OR
NOT
3. select ba.name,.basex,ba.old,in.email,in.shop
from base ba,info in
where ba.num=in.baseid
4. select ba.name,.basex,ba.old
from base ba
LEFT OUTER JOIN info in ON ba.num=in.id
5. ORDER BY name ^
ORDER BY name sex
ORDER BY name DESC 逆
6. GROUP BY name
7. INSERT INTO table (id, name) VALUES (values1,
values2)
8. INSERT INTO newtable
SELECT *
FROM table
9. DELETE FROM megaliths
WHERE location LIKE '%Wiltshire%'
10. UPDATE megaliths
SET location = 'Near Devizes, Wiltshire'
WHERE name = 'Avebury'
11. CREATE TABLE megaliths (
id INTEGER NOT NULL,
name VARCHAR(64),
location VARCHAR(64),
description VARCHAR(256),
site_type_id INTEGER,
mapref VARCHAR(16)
)
12.DROP TABLE megaliths
13.DROP DATABASE ****
14.ALTER TABLE tablename
CREATE TABLE user (id mediumint not null auto_increment,name varchar(30) not null,pass VARCHAR(64) not null,key (id));
阅读(751) | 评论(0) | 转发(0) |