使用CONCAT()函数 mysql向表中某字段后追加一段字符串(field为字段名): update table_name set field=CONCAT(field,'str',) mysql 向表中某字段前加字符串update table_name set field=CONCAT('str',field)…
1. 查询需要删除的记录,会保留一条记录. select a.id,a.subject,a.RECEIVER from test1 a left join (select c.subject,c.RECEIVER ,max(c.id) as bid from test1 c where status=0 GROUP BY RECEIVER,SUBJECT having count(1) >1) b on a.id< b.bid where a.subject=b.subject and a.R…