Link to home
Start Free TrialLog in
Avatar of rgb192
rgb192Flag for United States of America

asked on

sql server identical columns

want the count of rows where two int columns have the same values

1 2
1 2
1 2
count would be 3

4 5
4 5
6 5
count would be 2
Avatar of lcohan
lcohan
Flag of Canada image

you should run a SELECT and GROUP BY by those two columns
ASKER CERTIFIED SOLUTION
Avatar of lcohan
lcohan
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rgb192

ASKER

thanks
select intcolumn, count(*)
from table
group by intcolumn
having count(*) > 1;
I'm having a little trouble understanding the solution, which is only going to return one value, when your question seemed to indicate you were looking for multiple counts. Can you post how the query was used and what its results were?