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 |
|
bluestar
Posting Yak Master
133 Posts |
Posted - 2009-01-15 : 11:15:36
|
| helloI have a table named Linkage which will display external and internal linkages in a document.External linkages means user will create a link say www.yahoo.com.While creating internal element user will choose from system elements and creates its internal linkage which can be withing the same document or some different documentI have got 2 tablesTable Linkage and table SystemElementTable linkage have following columnsLinkageTitleText textSystemElementFrom intSystemElementTo intHyperlink ---this is for external linkageTable SystemElementSystemElementID intSystemElementTitleText textSystemElementFrom and SystemElementTo are nothing but SystemElementID's.which are also in SystemElement Table.Now I want to write a query which will display both Internal link---SystemElementTitleText and External link --Hyperlink.To display SystemElementTitleText I am writing the following querySelect s.SystemElementTitleText,s.SystemElementID,l.SystemElementLinkageID,l.LinkageTitleText,l.LinkageDescriptionText,l.LinkageFromType,l.LinkageToType,l.SystemElementFrom,l.SystemElementTo From SystemElement s,Linkage l where s.SystemElementID=l.SystemElementToAnd to display Hyperlink,following querySelect * From Linkage.I want both the parameters Hyperlink and SystemElementTitleText to display in result so I am doing Union of 2 select statement.But I am not getting the result.I even tried with JOIN ,but still in vain.Please help!!!!!!Thank You |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-01-15 : 23:39:53
|
| [code]select l.*,se1.SystemElementTitleText AS FromLink,se2.SystemElementTitleText AS ToLinkfrom linkage ljoin SystemElement se1ON se1.SystemElementID=l.SystemElementFromjoin SystemElement se2ON se2.SystemElementID=l.SystemElementTo[/code] |
 |
|
|
|
|
|
|
|