首页 新闻 赞助 找找看

请教,这两句查询语句怎么合并成一句啊,谢谢!

0
悬赏园豆:20 [已解决问题] 解决于 2010-11-26 09:11

如题:

语句1:

select m.mEmail,a.aAuditor from Members as m,taskApply as a where a.aAuditor=m.mName

语句2:

select count(*) from taskApply where aAuditor is not null group by aAuditor

MR.豆耐特的主页 MR.豆耐特 | 菜鸟二级 | 园豆:256
提问于:2010-11-25 17:56
< >
分享
最佳答案
0

试试这个select aAuditor,count(0),memail from taskApply left join members on members.mName=taskapply.aauditor where aAuditor is not null group by aAuditor,memail

收获园豆:20
老齐编程 | 初学一级 |园豆:137 | 2010-11-25 18:48
其他回答(3)
0

如果有group by

你要查询的字段要么在group by 后面  ,要么在  聚合函数里面   就像你第二个语句中的count(*)

写代码的小2B | 园豆:4371 (老鸟四级) | 2010-11-25 18:04
0

select m.mEmail,a.aAuditor,count(*) as val from Members as m,taskApply as a where a.aAuditor=m.mName

where aAuditor is not null  group by m.mEmail,a.aAuditor

大致语句应该是这样的,没有调试过,按照这个方向去试一下吧!

zhongweis | 园豆:30 (初学一级) | 2010-11-25 18:10
0

两条语句中间加上 ; 分号

然后 readnext() 读下下一句

慧☆星 | 园豆:5640 (大侠五级) | 2010-11-25 20:08
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册