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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Case when then , for two columns

Author  Topic 

bachnet
Starting Member

2 Posts

Posted - 2009-07-15 : 12:32:50
Hello everybody,
It's my first time that i post a issue on this forum,
I have a problem in my query, i have to make the followin

select case when ColX LIKE 'anyth%' then 'hello'
when ColY like 'othe%' then ColX= 'hello'
else ColX end
from ...

how can i make that?
Thanks in advance,if you need more clarification please contact me asap

Best Regards

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-07-15 : 12:37:58
[code]select ColX= case when ColX LIKE 'anyth%' then 'hello'
when ColY like 'othe%' then 'hello'
else ColX end
....
[/code]
Go to Top of Page

bachnet
Starting Member

2 Posts

Posted - 2009-07-15 : 14:47:05
Thank you it's working, infact my query also is working but i has a unaccurate data.

Thank you again
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-07-16 : 12:49:19
welcome
Go to Top of Page
   

- Advertisement -