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 |
|
Easwar
Yak Posting Veteran
59 Posts |
Posted - 2007-03-22 : 07:28:27
|
| This is my sample table Datatable1TagID|TagName--------------1|xyz2|123abc3|a3bc4|arsdew5|xyc324............................TagID--Primary Keytable2TopicID|Topic----------------1|jkkj2|kjgg 3|jhkj4|refc 5|huhf8|fyhj 9|jjk......................................TopicID---Primary Keytable3DetID|TagID|TopicID-----------------------1|1|12|1|23|1|34|2|45|2|58|3|89|3|9........................................................DetID---Primary keyTagID and TopicID----Foreign keyi need Topic based on TagName. This xyz(TagName) have a 3 Topic. i need the 3 Topic Once i select 123abc(TagName) that particular Topic I need..any Query in Single Line....................... |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-03-22 : 07:37:13
|
there you go . . . Query in Single Lineselect t2.topic from table1 t1 join table3 t3 on t1.tagid = t3.tagid join table2 t2 on t3.topicid = t2.topicid where t1.tagname=@tagname KH |
 |
|
|
Easwar
Yak Posting Veteran
59 Posts |
Posted - 2007-03-22 : 07:54:54
|
| Thanks very much............. |
 |
|
|
|
|
|