|
dhani
Posting Yak Master
132 Posts |
Posted - 2009-04-03 : 19:10:02
|
| Query 1=======Select info,recNum from HoldRecs inner join holdrecsdefinitions on Holdrecs.id=Holdrecsdefinition.id where submit=1089 and id=10889unionSelect info,recNum from HoldRecs where submit=2082 and id=1889Result of Query 1=============info,RecNum-------------1,102,123,144,16It Park,18King Hotel, 20,21Query2========Select info,recNum from HoldRecs where submit=2082 and id=1889unionSelect info,recNum from HoldRecs where submit=2082 and id=1889info,RecNum-------------Emerald Sq,10Green Elizabeth,12Good Ofa,14MenloPark,16Kubusa,18Zing, 20,21now the question is how can i get the all first query data with second query first column(info column alias as address) as third column in query 1so expected output will be as belowif i use union it gives the result below the column (i need it as row wise)info,RecNum,address----------------------1,10,Emerald Sq2,12,Green Elizabeth3,14,Good Ofa4,16,MenloParkIt Park,18,KubusaKing Hotel, 20,Zing,21,Please help me, any ideasplease, really appreciate itBest Regardsasini |
|