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 |
|
fmardani
Constraint Violating Yak Guru
433 Posts |
Posted - 2007-01-10 : 11:26:58
|
| There are two tables:for example:tblCurrenciesCurrencyID, Name1 USD2 GBP3 CAD4 JPYtblCurrencyPairsCurrencypairID, Currency1ID, Currency2ID1 4 12 1 35 2 1How can I write a sql query to show the fields in tblCurrencypairs, but to show the currencyNames concatenated instead of their IDs. So table tblCurrencyPairs should show something like:CurrencypairID, CurrencyPairs1 JPYUSD2 USDCAD5 GBPUSDThanks |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-01-10 : 11:43:24
|
| select cp.currencypairid, t1.name + t2.namefrom tblcurrencypairs as cpinner join tblcurrencies as t1 on t1.currencyid = cp.current1idinner join tblcurrencies as t2 on t2.currencyid = cp.current2idorder by cp.currencypairidPeter LarssonHelsingborg, Sweden |
 |
|
|
|
|
|