1.mysql 模糊匹配 like 与 not like 用法 : SELECT * FROM `user` where `nickname` LIKE '%测试%' SELECT * FROM `user` where `nickname` not LIKE '%测试%' 2.mysql 批量替换replace函数用法 : 替换某个字段,replace可以替换某个字段中的指定的某个部分,replace(column_name,oldregexstr,newreplacestr) 替换表一行,
update `wp_posts` set `post_content`=REPLACE(`post_content`,'localhost/linkcp','www.linkcp.cn') where `post_content` like '%localhost/linkcp%'; 替换wp_post表post_content列中的localhost/linkcp字段为www.linkcp.cn 查询条件是post_content字段中有类似localhost/linkcp的字段
一 . SELECT * FROM (SELECT A.*, rownum AS RN FROM (SELECT (@rownum := @rownum + 1) AS rownum, B.LL11, B.KS01 FROM TA_HISTORY B,(SELECT @rownum := 0) r WHERE 1 = 1 AND B.KS01 > '2017-10-8 9:51' AND B.KS01 < '2017-11-8 9:51' ORDER BY B.KS01 DESC) A ) C