select to_char(a1.createDate,'yyyy-MM-dd'),a1.type , count(*)
,(select count(*) from table2 a2 where a2.callid in (a1.callid))
from table1 a1 group by to_char(a1.createDate,'yyyy-MM-dd'), a1.type
...全文
54回复打赏收藏
求教SQL一条语句
求教SQL语句, 表table1,字段为:createdate type callid 三个字段 表table2,字段为:createdate callid 两个字段 想实现效果,例如:按createdate和type分组后,如2010-10-01,type等于1的有10条记录, 在table2表中callid等于这10条记录的callid有多少条 如下的语句不对,请问应该怎么改?谢谢 select to_char(a1.createDate,'yyyy-MM-dd'),a1.type , co