mysql数据库查询查重

71次阅读
没有评论

例子 SELECT A.*,FROM_UNIXTIME(A.last_time,’%Y-%m-%d’)//年月日转化 AS aa FROM users A INNER JOIN
(SELECT user_id, cp_name,cp_date,email, COUNT(cp_name) FROM users GROUP BY cp_name HAVING COUNT(cp_name)>1) B ON A.cp_name=B.cp_name;

正文完
 
评论(没有评论)