select replicationTime, count(*) as CountsForNoMatches
from table
where ID IS NULL
Group By ReplicationTime
Like this
select replicationTime, sum(case when ID is null then 1 else 0 end) as CountsForNoMatches
from table
Group By ReplicationTime
or
select replicationTime, max(case when ID is null then 1 else 0 end) as CountsForNoMatches
from table
Group By ReplicationTime
if you just want to know if there is some row with a null ID for that ReplicationTime.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.