一些以前用过的sql语句

# 将数据库字段中的特殊字符替换
UPDATE my_article_content SET content=REPLACE(content,'”',''),content=REPLACE(content,'“',''),content=REPLACE(content,' ',''),content=REPLACE(content,'…','')

# 查找重复记录
SELECT count(id) ids  FROM may_private_art  GROUP BY title  order by ids desc

# 删除重复数据
DELETE FROM `may_private_art` WHERE id NOT IN(SELECT * FROM(SELECT id FROM `may_private_art` GROUP BY title)AS b)

0
0
Tags:

发表回复

Your email address will not be published. Required fields are marked *.

*
*