SQL语句DML语句总结

查询:

1、用一个表更新另一个表SQL
UPDATE a,b set a.title = b.title where a.id = b.aid;
2、表中有多条数据取最新一条(子查询解决方案)
//select * from (select * from `test` order by `date` desc) `temp`  group by product_code order by `date` desc  效率太慢

猜你喜欢

转载自my.oschina.net/u/2292141/blog/1630929