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 |
|
OldMySQLUser
Constraint Violating Yak Guru
301 Posts |
Posted - 2008-01-25 : 12:23:55
|
| I have two tables (MS SQL 2005)Table 1-------account_number transaction_type date_entered user34 1 12-12-2007 Bill65 6 14-12-2007 Wayne Table 2-------transaction_type transaction_description 1 New account2 Stale account3 Poor payer4 Frozen account5 Lapsed account6 Premium accountHow, please, can I create a SELECT which will give me:account_number transaction_type date_entered user65 Premium account 14-12-2007 Wayne |
|
|
jdaman
Constraint Violating Yak Guru
354 Posts |
Posted - 2008-01-25 : 12:38:02
|
| [code]SELECT t1.account_number, t2.transaction_description AS transaction_type, t1.date_entered, t1.userFROM Table1 t1JOIN Table2 t2 ON t1.transaction_type = t2.transaction_type[/code] |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-01-25 : 22:55:29
|
| also you need to filter on transaction_description WHERE t2.transaction_description ='Premium account' |
 |
|
|
|
|
|