Balu's Technical Blog
Sunday, March 30, 2014
SQL: query occurrences of multiple fields in a table
student_record is table name.
id, name, email are column names.
counting more than one occurrences for above column.
SELECT id, name , email,
COUNT(id) AS NumOccurrences
FROM student_record
GROUP BY id, name, email
HAVING ( COUNT(id) > 1 );
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment