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 |
|
bilencekic
Posting Yak Master
121 Posts |
Posted - 2007-05-18 : 07:36:35
|
| hi,i have text column named ERRORquery like thisselect.....case Errorwhen 'xxx' then 1when 'yyy' then 2end as Condition...when i add the where clause it doenst work. for ex;when i use "where Condition = 0 "table returns all the conditionswhy ?i tried "where Condition = '0' "it doesnt work too.MS BLESS US |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-05-18 : 07:49:25
|
| [code]Select * from(select ....case Errorwhen 'xxx' then 1when 'yyy' then 2end as Condition...) tWhere condition = 0[/code]Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
bilencekic
Posting Yak Master
121 Posts |
Posted - 2007-05-18 : 08:28:25
|
| arghhnoselect t.a,t.b,t.c,(select case errorwhen 'xxx' then 1end as conditionwhere tablename.ID = t.ID ) as t,form tablename t inner join.....well on the result i see the T column but when i add the where t = 0 to the end of queryit gives error that there is no column named t MS BLESS US |
 |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-05-18 : 08:33:09
|
| Post your complete query here.Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
bilencekic
Posting Yak Master
121 Posts |
Posted - 2007-05-18 : 08:35:10
|
| ok fixed. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-05-18 : 11:36:40
|
quote: Originally posted by bilencekic ok fixed.
Why dont you show us fixed query?MadhivananFailing to plan is Planning to fail |
 |
|
|
mahesh_bote
Constraint Violating Yak Guru
298 Posts |
Posted - 2007-05-18 : 12:02:34
|
quote: Originally posted by bilencekic arghhnoselect t.a,t.b,t.c,(select case errorwhen 'xxx' then 1end as conditionwhere tablename.ID = t.ID ) as t,form tablename t inner join.....well on the result i see the T column but when i add the where t = 0 to the end of queryit gives error that there is no column named t MS BLESS US
remove comma and replce form with fromthx,Mahesh |
 |
|
|
|
|
|