vcujackson
Technical User
I have the following code
select id,date,class
from field1
having count(id) >1
My desired output is
ID date class
11 9/15/09 c
11 5/1/09 d
The only way an id should appear more than once is if it has multiple classes for the same id. Else I do not want it to appear. So a full listing looks like
ID date class
11 9/15/09 c show
11 5/1/09 d show
12 12/15/09 c not show
14 9/10/09 c not show
So I want the first two to show not the last two. Essentially I am counting to see if the rows have the same value. If so I want to list them. If not I want to eliminate them
select id,date,class
from field1
having count(id) >1
My desired output is
ID date class
11 9/15/09 c
11 5/1/09 d
The only way an id should appear more than once is if it has multiple classes for the same id. Else I do not want it to appear. So a full listing looks like
ID date class
11 9/15/09 c show
11 5/1/09 d show
12 12/15/09 c not show
14 9/10/09 c not show
So I want the first two to show not the last two. Essentially I am counting to see if the rows have the same value. If so I want to list them. If not I want to eliminate them