/* How do I find a duplicate record? */ /* below will tell me if there are multiple students with same fname & sex */ SELECT fname, sex, COUNT(*) FROM student GROUP BY fname, sex HAVING count(*) > 1; /* From the above - */ /* Now that I know, that there are multiple rows */ /* I want the rest of the data from that table */ /* inline views will be covered in the future */ SELECT * /* or whatever columns you need */ FROM student o, ( SELECT fname, sex, COUNT(*) /* inline view */ FROM student GROUP BY fname, sex HAVING count(fname) > 1 ) i WHERE o.fname = i.fname /* correlated subquery */ AND o.sex = i.sex;