mysql常见问题

mysql常见问题

select * from table where id IN (3,6,9,1,2,5,8,7) order by field(id,3,6,9,1,2,5,8,7); 

 

MYSQL使用group by时,查询结果的总记录数

SELECT COUNT(*) FROM (SELECT COUNT(*) FROM tb_lm_channel_everytj GROUP BY `date` ) a ;

 

mysql 替换某个字段里相同之处的字符 简化版

UPDATE tb_charpter SET charpterName = REPLACE ( charpterName,'a' 'b' ) WHERE bid = 30105;

 

mysql 替换某个字段里相同之处的字符

UPDATE tb_charpter SET charpterName = REPLACE ( charpterName, substring( charpterName, locate('', charpterName), locate('', charpterName) - locate('', charpterName) + 1 ), '' ) WHERE bid = 30105

 

posted @ 2019-09-02 11:36  斌-逸风  阅读(175)  评论(0编辑  收藏  举报