1.substring_index(字段名,截取标识符,出现的次数)负数是从右边截取
eg:
update yg_cloud_codes_1 set cg_len=SUBSTRING_INDEX(SUBSTRING_INDEX(cg_codes_tmp,":",2),":",-1)
这样就截取了图中的3000
2.substring(字段名,开始位置,结束位置)
select *, substring(room_id,4) as rid from replay_user_tbl
order by id desc limit 1,10
3.left(字段名,结束位置)
select *, left(room_id,4) as rid from replay_user_tbl
order by id desc limit 1,10
find_in_set
5.group操作后,拼接指定字段的数据
select tax_type,GROUP_CONCAT(group_id SEPARATOR ',' ) groupids FROM game_tax_tbl
GROUP BY tax_type;