Selecting difference between two tables returns different number of results than counts of same two tables
0
votes
1
answer
314
views
I'm using SQL Server and when I run
SELECT * FROM TABLE1 EXCEPT SELECT * FROM TABLE2
it returns 1610 entries. When I query
`
SELECT COUNT(*) FROM TABLE1
SELECT COUNT(*) FROM TABLE2
`
I get 6399 and 4583, the difference of which is 1546, not 1610 as I would expect from the first query. What could be causing this discrepancy between the number of results returned and the difference of the individual table counts?
Asked by Casivio
(125 rep)
Mar 25, 2020, 09:24 PM
Last activity: Mar 26, 2020, 03:03 AM
Last activity: Mar 26, 2020, 03:03 AM