Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Need help with the query...

Author  Topic 

Sanatan
Starting Member

19 Posts

Posted - 2009-03-12 : 16:48:34
Hi I need some help with the following SQL Query.

OwnerTable
MAPCOL OWNERCOL
Map1 Owner1
Map1 Owner2
Map2 Owner1
Map3 Owner2
Map3 Owner3

RelationTable
KEYCOL MAPCOL
Key1 Map1
Key1 Map2
Key2 Map2
Key2 Map3
Key3 Map3

ProcessTable (KEYVAL+COLVAL forms a Primary key)
KEYCOL VALCOL
Key1 Val1
Key1 Val2
Key2 Val3
Key3 Val3

Query Result should be retrived from the ProcessTable as below
For Owner1
----------
Val1
Val2

For Owner2
----------
Val1
val2
Val3

For Owner3
----------
Val3

Please let me know if more clarification is needed of the table structure. Thanks in advance.

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-03-12 : 16:50:16
Just do as I showed you here
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=121519



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page
   

- Advertisement -