select * from table_name order by DESC(降序排列) LIMIT 5(只獲取前5行的數(shù)據(jù))
select * from table_name(默認升序排列) LIMIT 5,10(返回第6行到第16行的數(shù)據(jù))
批量更新
uptate T_table set type =1 where find_in_set(id,“1,2,3,4”)//將id = 1,2,3,4的type字段設(shè)置為1
UPDATE T_table SET user_type = 1
WHERE FIND_IN_SET(id,#{_parament}) //xml中這樣配置