mysql去重
2016-05-25 13:47
435 查看
select a.id,a.ssmz,(select count(ssmz) from shop_tourist_key b where b.ssmz=a.ssmz) as count
from shop_tourist_key a WHERE a.ssmz is not null group by a.ssmz LIMIT 0,3;
select a.id,a.ssmz,(select count(ssmz) from shop_tourist_key b where b.ssmz=a.ssmz) as count
from shop_tourist_key a where ISNULL(a.ssmz)=false group by a.ssmz order by count DESC
LIMIT 0,3;
select a.id,a.ssmz,(select count(ssmz) from shop_tourist_key b where b.ssmz=a.ssmz) as count,
count(distinct a.ssmz) from shop_tourist_key a group by a.ssmz LIMIT 0,3 ;
from shop_tourist_key a WHERE a.ssmz is not null group by a.ssmz LIMIT 0,3;
select a.id,a.ssmz,(select count(ssmz) from shop_tourist_key b where b.ssmz=a.ssmz) as count
from shop_tourist_key a where ISNULL(a.ssmz)=false group by a.ssmz order by count DESC
LIMIT 0,3;
select a.id,a.ssmz,(select count(ssmz) from shop_tourist_key b where b.ssmz=a.ssmz) as count,
count(distinct a.ssmz) from shop_tourist_key a group by a.ssmz LIMIT 0,3 ;
相关文章推荐
- 【未解决 存疑】jsp中乱码问题,修改mysql5.6 character_set_results
- MySQL max_allowed_packet设置及问题
- com.mysql.jdbc.PacketTooBigException 问题解决
- MySQL编码latin1转utf8
- MySQL 资源大全中文版
- mac下mysql的DMG格式安装卸载方法
- mysql replication inside
- 查看mysql存储引擎
- mysql Convert/Import MWB to SQL File in workbench
- 如何从mySQL 中导出数据库?
- 初探 MySQL 的 Binlog
- mysql-ignore、replace、on duplicate key update(不存在则插入,存在则更新)
- MySQL DEBUG_SYNC 的简单分析与测试
- taobao月报 ---mysql汇总
- MYSQL优化20条经验
- Windows Server 2012 下安装MySQL 5.6 X64位包
- 将数据文件插入到mysql
- MySQL如何选择float, double, decimal
- MySql使用命令行登录
- [Mysql]事物处理