How do you select duplicate fields from a single table? If the table looked like this:
a 5 b
c 5 d
e 5 f
g 6 h
z 4 y
I would need to select the first three records because they each have a duplicate field2 value.I'm thinking it would look something like this:
SELECT field1,field2,field3 FROM table WHERE field2 EXISTS (more than 1 time);
Or this:
SELECT field1,field2,field3 FROM table WHERE COUNT(SELECT field2 FROM table) > 1;
Thanks.
a 5 b
c 5 d
e 5 f
g 6 h
z 4 y
I would need to select the first three records because they each have a duplicate field2 value.I'm thinking it would look something like this:
SELECT field1,field2,field3 FROM table WHERE field2 EXISTS (more than 1 time);
Or this:
SELECT field1,field2,field3 FROM table WHERE COUNT(SELECT field2 FROM table) > 1;
Thanks.
Last edited: