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.
Author |
Topic |
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2003-10-31 : 07:57:30
|
Zimon writes "I have a table of items as follows:Item_ID Item_Name1 Pish2 Posh3 PashI have a table of associations as follows:Item1_ID Item2_ID1 22 3I need the output:First_Item Second_ItemPish PoshPosh PashBut after days of trying and internet searching I have no idea how to structure the SQLServer query. Please can you help or confirm that this is an imposibility.Zimon" |
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2003-10-31 : 07:59:02
|
<wiping away tears of laughter>Try this:http://www.sqlteam.com/item.asp?ItemID=8866</wiping away tears of laughter>Although you can probably get away with:SELECT A.Item_Name, B.Item_NameFROM myTable A INNER JOIN Association C ON A.Item1_ID INNER JOIN myTable B ON C.Item2_ID=B.Item_IDAnd if you REALLY meant what the title states, then perhaps this is what you need:http://www.amazon.com/exec/obidos/tg/detail/-/0517886073/102-8441179-3137755?v=glance |
|
|
Merkin
Funky Drop Bear Fearing SQL Dude!
4970 Posts |
Posted - 2003-10-31 : 08:10:56
|
I knew you were gonna have some fun with that one when I saw it in the queue Damian |
|
|
homam
Starting Member
31 Posts |
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2003-10-31 : 08:14:02
|
LOL .... almost fell out of my chair ....- Jeff |
|
|
ehorn
Master Smack Fu Yak Hacker
1632 Posts |
Posted - 2003-10-31 : 08:14:06
|
Spilled coffee on my laptop http://www.webheights.net/lovethyself/home.htm |
|
|
|
|
|