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 |
jess1984
Starting Member
14 Posts |
Posted - 2011-01-06 : 03:46:45
|
hai,how to write query --case statement in where codition.plz helpThanksJessjess1984 |
|
Lumbago
Norsk Yak Master
3271 Posts |
Posted - 2011-01-06 : 04:05:25
|
[code]DECLARE @myVariable int = 3SELECT *FROM tableWHERE Column = CASE WHEN @myVariable < 3 THEN 'Small' WHEN @myVariable >= 3 AND < 10 THEN 'Medium' ELSE 'Large' END[/code]- LumbagoMy blog (yes, I have a blog now! just not that much content yet) -> www.thefirstsql.com |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2011-01-06 : 05:17:36
|
Change DECLARE @myVariable int = 3toDECLARE @myVariable int SET @myVariable = 3MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|