删除重复数据

admin3年前mysql657

DELETE t1 FROM invest_year t1, invest_year t2 WHERE t1.pro_id = t2.pro_id AND t1.pro_year = t2.pro_year AND t1.id > t2.id;

自关联,保留id最小的那一条,其它的都删除

相关文章

MYSQL当天日期

SELECT CURDATE()当天日期...

MySQL判断字符串是否是数字

SELECT * FROM ****  WHERE  trim(字段名) REGEXP '[^0-9]'=1...

Mysql 存储过程的使用要点

if the end if 最后需要用分号';'结束out的值在select 中需要用 into赋值 其他情况 可以尝试setphp获取out的值需要$sql="call&n...

mysql替换字段内的内容

update 表名 SET log_Content = REPLACE(log_Content,'"upload','"/upload')...

mysql的字符串连接符

mysql> select CONCAT('My', 'S', 'QL');...

发表评论    

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。