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 |
cbillson
Starting Member
2 Posts |
Posted - 2014-09-12 : 04:30:20
|
Hi, wonder if anyone could help me with this, and if its possible? I have some SQL experience, but nothing past basic commands. I'm trying to take some data held by an application to use as CSV import into another application.I have two tables from an application, one holds references made in another.The first tables holds details about a person:field1=name field2=age field3=country Joe,50,1Country is held as a number, then there is another table that holds all the countries:field1=id field2=description 1,USA 2,France 3,GermanyI want to do a lookup where it returns: Joe,50,USAin my head this is a select within a select, but i'm not even sure what to start searching in Google for this - can anyone assist?ThanksChris |
|
gbritton
Master Smack Fu Yak Hacker
2780 Posts |
Posted - 2014-09-12 : 08:17:29
|
[CODE]select NAME + ',' + CAST(age AS VARCHAR(10)) + ',' + descr from @t1 t1 join @t2 t2on t1.country = t2.id[/CODE] |
|
|
|
|
|
|
|