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 |
teamjai
Yak Posting Veteran
52 Posts |
Posted - 2013-11-07 : 04:31:55
|
i have Two table1) CountryID Name----- ---------123 UK456 US789 SF 2)DocumentDid DName Description CountryID------- -------- ------------ -----------111 Test Sample 123 222 TTest SSample 789i need to retrive the value from Document table.Example:Select CountryID from Document where Did = 111The above query return Country id , but i need to return Country NameExcepted O/p --> UKPlease helpThanks |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-11-07 : 04:38:01
|
just a simple joinSELECT c.NameFROM Country cINNER JOIN Document dON d.CountryID = c.IDWHERE Did = 111 ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
|
|
|