第1个回答 2017-03-13
dt是指同一天么?select a.id ,b.id , count(1)from table a left join table b on CONVERT(varchar(10), a.time, 112)=CONVERT(varchar(10), b.time, 112) and a.status = b.status and a.id < b.idwhere b.id is not nullgroup by a.id,b.idorder by a.id上百亿条?