美文网首页
前端数据库日常小记

前端数据库日常小记

作者: 飘落的枫 | 来源:发表于2017-02-28 17:59 被阅读11次

select * from table_name order by DESC(降序排列) LIMIT 5(只获取前5行的数据)

select * from table_name(默认升序排列) LIMIT 5,10(返回第6行到第16行的数据)

批量更新
uptate T_table set type =1 where find_in_set(id,“1,2,3,4”)//将id = 1,2,3,4的type字段设置为1

UPDATE T_table SET user_type = 1

WHERE FIND_IN_SET(id,#{_parament}) //xml中这样配置

相关文章

网友评论

      本文标题:前端数据库日常小记

      本文链接:https://www.haomeiwen.com/subject/jntfgttx.html