I have the following request
Select count(*) as TotalCount from ABC where ID in (1,3,6)
The problem here is that it gives me a total of 1.3 and 6. But I would like to get a quantity for each identifier, as shown below:
TotalCount, ID 6, 1 2, 3 5, 6
Please let me know the SQL Server query to achieve this. I would not prefer to use temporary tables.
source share