????SQL ?е? SELECT ?????????????????????????е?????????????? WHERE ???????????????????????????????????С?
?????????????? WHERE ???
????????????? SELECT??INSERT??UPDATE ?? DELETE ????????á?
?????????? SELECT ???????????
SELECT id?? name
FROM table1
WHERE id in (
SELECT id
FROM table2);
?????????????????????У???????????????????????????? in ????????????????????????? table1 ?? table2 ?е? id ??
???????WHERE ????е?????????????????Χ????????????????????????????????????????????
?????????????????????????????? =??<??>??>=??<=??IN??BETWEEN ????????????磺
SELECT id?? name FROM table1
WHERE id = (
SELECT id
FROM table2
WHERE name = "xxx");
??????????У?
SELECT id?? name FROM table1
WHERE (name?? age) = (
SELECT name?? age
FROM table2
WHERE id = 3);
????????????????????????????? in ???????????
???????磺
SELECT email
FROM table1
WHERE id in (
SELECT id
FROM table2);
????????????????????
?????????????????????????????????????????У????磺
INSERT INTO newtable
SELECT * FROM oldtable
WHERE id > 100;
???????????????????У?
INSERT INTO newtable (id?? name)
SELECT id?? name FROM oldtable
WHERE id < 50;
????????????????????????????????????Χ??