Tbl_cdr(ano,starttime)
Tbl_User(id,mobileno)
我想计算来自Tbl_cdr
的行,条件是省略行(ano = mobileno
时)和starttime
分组。
任何帮助,Plz ......
答案 0 :(得分:3)
select c.starttime, count(*)
from Tbl_cdr c
where not exists (select 1 from Tbl_User u where u.mobileno = c.ano)
group by c.starttime
答案 1 :(得分:2)
select count(*), c.StartTime from Tbl_cdr c left join Tbl_User u on c.ano = u.mobileno where u.id is null group by c.StartTime