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 |
|
sqlfresher2k7
Aged Yak Warrior
623 Posts |
Posted - 2009-04-28 : 16:03:16
|
| Query requiredTable:State Stid desc---- -----22 GA32 NY42 CATable:TransStudentID Fees Resd --------- ---- -----1000 1000 GA 2000 500 CA 3000 500 NYI need an output like below StudentID Fees Resd --------- ---- -----1000 1000 22 2000 500 32 3000 500 42 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-04-28 : 16:04:42
|
SELECT t.StudentID, t.Fees, s.Stid AS ResdFROM Trans AS tINNER JOIN State AS s ON s.desc = t.Resd E 12°55'05.63"N 56°04'39.26" |
 |
|
|
bklr
Master Smack Fu Yak Hacker
1693 Posts |
Posted - 2009-04-29 : 04:24:45
|
| try this too SELECT t.StudentID, t.Fees, (select stid from state where desc = t.Resd) AS ResdFROM Trans AS t |
 |
|
|
|
|
|