![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
We have two tables and data similar as below Table: MASTER -------------------- Master_id - Dsite -------------------- 1 - NewYork 2 - Tokiyo -------------------- Table: DETAILS --------------------------------- Master_id - item_id - owner --------------------------------- 1 - id1 - James 1 - id1 - Eva 1 - id2 - Dave 1 - id3 - John 2 - id1 - Suzy 2 - id1 - Smith 2 - id4 - Ravi --------------------------------- We want to list the result set as all those item_ids and owners for which the item_id is associated with more than one masterids. So the result for the above example would be as below - Item_id - Owner Id1 - James Id1 - Eva Id1 - suzy Id1 - smith How should one write SQL query for such scenario? Thanks in advance for your help. |
![]() |
| Thread Tools | |
| Display Modes | |
| |