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

如题:

语句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

噜噜哒
浏览 564回答 4
4回答

元芳怎么了

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

守着星空守着你

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 大致语句应该是这样的,没有调试过,按照这个方向去试一下吧!
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

SQL Server