sql - Finding One record from table having unique PK and duplicate FK -


i want 1 record table having unique primary key , duplicate foreign key

please see attached image below

alt text http://img413.imageshack.us/img413/9940/findduplicate.png

thanks

select fk, count(*)  table1 group fk having count(*) > 1 

Comments

Popular posts from this blog

ruby - When to use an ORM (Sequel, Datamapper, AR, etc.) vs. pure SQL for querying -

php - PHPDoc: @return void necessary? -

c++ - Convert big endian to little endian when reading from a binary file -