I want to select all rows where the name is the identical; i.e. in this example, I want to select row 1 and 3. Does anyone know the correct syntax for this statement? (I tried to solve it by using a view, but that wasn't the right track....)
-Thanks a lot!
Dan
06-12-2001, 08:12 AM
m1l
I don't know if this helps but one command you might want to think about is HAVING. So if you do
SELECT name
FROM table
GROUP BY name
HAVING COUNT(*) > 1
This would display all names where there is more than one record in the table with the same name.
06-12-2001, 08:14 AM
SHANKAR
select * from TAB
where name in(select name from TAB group by name having count(1) > 1)
06-12-2001, 08:17 AM
Dan1
Hi,
that's exactly what I've been looking for! Thanks a lot for the hint!
Dan
06-12-2001, 08:23 AM
PSoni
Hi
Try this
Select * from table_name
where name in (select name
from table_name
group by name
having count(name) >= 2)