SQL query for this purpose
From: MadhavC <choudharymv_at_gmail.com>
Date: Sun, 3 Feb 2008 23:05:08 -0800 (PST)
Message-ID: <17543b1c-0e0e-447d-8bed-2fd5b34d9d15@s13g2000prd.googlegroups.com>
Master_id - Dsite
Master_id - item_id - owner
Date: Sun, 3 Feb 2008 23:05:08 -0800 (PST)
Message-ID: <17543b1c-0e0e-447d-8bed-2fd5b34d9d15@s13g2000prd.googlegroups.com>
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. Received on Mon Feb 04 2008 - 01:05:08 CST