Search Results:

Tuesday, October 6, 2009

Query to find no of multiple columns

SELECT id, COUNT(id) AS NumOccurrences
FROM Driver_History
GROUP BY id
HAVING (COUNT(id) = 2)


This above query gives all the rows that have same id's.

No comments:

Post a Comment