postgresql - SQL to find duplicate foreign keys in a group -
Originally with tables:
element ID INT primary key ... Overview ID INT primary key ... Data ID INT Primary key view_ID floats key key element_id foreign key price ... I think all the will then report the query (I am using PostgreSQL, but this is probably a basic SQL question.) observation_id Duplicate element_id s in overview_id . For example, if I have data record:
1 | 50 | 23 4.5 2 50 | 24 | 9.93 | 66 | 23 4.4 4 66 | 23 4.1 overview_id 66 because it contains element_id 23 .
Use counting () Overall, with the 'Happening' section:
select_view, select element_id, Element_id count (*)> 1
Comments
Post a Comment