Using SQL Server 2000
I Want to Check the colum value whether it is same or not
Table1
ID Value
001 1000
002 1000
003 5000
From the above table, nothing display in the output, because values are differenct for each id.
If the values are same for all the id, then display otherwise nothing display.
How to make a select query.
Need Query Help
This code will look at the number of duplicate Values for an ID, and return:
ID, Duplicate Value, number of times this value exists in the table.
SELECT Id, Value
, COUNT(1) AS occurances
FROM Table1
GROUP BY ID, VALUE
HAVING COUNT(1) > 1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With