http://qiutian110119.blog.163.com/blog/static/54617311201131015915294/
1.insert
批量添加
insert into xxx values (), (), ()
2.update
级联更新
update A, B set A.a = a1, B.b = b1 where A.id = B.aid
3.delete
级联删除
delete A, B from A, B where A.id = B.aid
4.limit
select * from x
limit 2
返回第2条结果
or limit 2, 10
返回第2条到第12条结果
5.group by
select A.name, sum(A.num), A.price
from A
group by A.name
其他的数据库对此sql语句会报错,而mysql则不会。
A.price从组中任选一个。
6.rand()
select * from A order by rand()
随机排序
7.replace
replace into x values(...)
或者
replace into x select * from y