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 |
Kimi86
Yak Posting Veteran
79 Posts |
Posted - 2012-07-12 : 09:34:37
|
I am creating a view joining many table. One of the columnis being derieved from one of the columns using simple case statement and then i need to join some other table with this new derieved column... But the join is not working even though there is no error when i execute.. any iseas?? |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2012-07-12 : 09:40:22
|
Post the code you have usedMadhivananFailing to plan is Planning to fail |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-07-12 : 10:12:18
|
you need to form a derived table and then use it in joinlikeSELECT ...FROM (SELECT othercolumn,CASE WHEN .... AS yourderivedcol,... FROM yourtable) dtJOIN Yourothertable tON t.col = dt.derviedcol... ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
Kimi86
Yak Posting Veteran
79 Posts |
Posted - 2012-07-12 : 10:24:17
|
bang on reply... This is what i eventually ended up doing but just wanted to confirm .. thanks |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-07-12 : 11:06:50
|
welcome------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|