count字段表示什么?统计拨打的次数。
解决方案 »
- 增大innodb_log_file_size,是不是必须要删除原有的ib_logfile0, ib_logfile1文件
- lomboz-Eclipse中用database Explorer查看数据乱码
- MYSQL 奇怪问题。自动停止。
- 求助:一条查询的sql语句!!
- 请教在bin下执行./mysqldump -u someone -p db < db.sql和./mysql -u someone -p db < db.sql的区别
- Mysql中奇怪的问题,请救急!(字符集)
- Can't connect to MySQL server on 'localhost' (10048) 错误
- 从jsp页面中往mysql里面加数据,tomcat报错:SQLException: Invalid authorization specification: Access denied for user: 'root
- 关于mysql处理sql语句的疑问,为什么错误sql语句会导致数据库性能下降
- mysql 多对多映射关系的筛选SQL怎么写
- 请问如何在mysql运行扩展名为.sql的文件啊!?
- 请问如何将sql anywhere 的db数据库文件导入到mysql中啊?若是在odbc中设置了数据源又如何导入?
有两个表如下
phone_t
id name phone
0 a 110
1 aa 110
2 bb 110
3 aa 120
4 dd 119call
id name
1 aa
2 aa
callphone
callid phone
1 110
2 110
查询出如下结果
id name phone count
0 a 110 0
1 aa 110 2
2 bb 110 0
3 cc 120 0
4 dd 119 0
如何用一个sql语句实现
left outer join
(
select a.id,a.name ,a.phone,count(*) as count from phone_t a, call b, callphone c where a.name = b.name and a.phone = c.phone and b.id = c.callid
group by a.id,a.name ,a.phone
) b
on a.id = b.id and a.name = b.name and a.phone = b.phone请以后把构造的数据写上,都比较忙,没时间呀!
to yangyouyi(yangyouyi)
你有没有搞错!凭什么说我是小妹妹呀?说说理由先!