常用SQL语句

筛选重复的数据

Select mobile From `users` Group By mobile Having Count(*)>1

查询到所有重复的用户信息sql语句:

select * from users  a
right join ( Select * From `users` Group By card_num Having Count(*)>1 ) b on a.card_num = b.card_num
order by a.card_num 

去重查询数量

SELECT COUNT(DISTINCT IP) FROM logs WHERE `HTTP` LIKE '%/sh/%';

 2,610 total views,  2 views today

Revisions

No comments yet.

发表评论