mysql中常用的select语句记录

1:带条件查询,查询ID=2的数据

SELECT * FROM table WHERE ID = 2

2:查询前几条数据,如查询前2条数据

SELECT * FROM table LIMIT 2

 3:降序/升序查询 desc降序 asc是升序

SELECT * FROM table order by number desc

 4:更新

UPDATE musictable SET likeNumber = 110  where ID = 3

 

posted @ 2015-11-05 17:04  笨·大叔  阅读(267)  评论(0编辑  收藏  举报