Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

Count(*) giving different record count than Group by

$
0
0

I have a table which is giving me different record counts as below:

SELECT COUNT(1) FROM tbl_A --45104 records

SELECT ID,COUNT(*) FROM tbl_A GROUP BY ID ORDER BY 1   --42084 records(ID is the primary key)

Any idea why this will happen?


Viewing all articles
Browse latest Browse all 7129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>