-
Case statement in where clause
can i use case statement in where clause.
The scenario is as follow
declare @param int
select
*
from
table1
where
column1 = 'asdf'
column2= @param
In the above sql, if @param is '' then i don't want to include it in the where clause.I can use "like" statement for that, but i want exact value not partial value.
can i use case in where clause so that if @param is '' then i will not include in the where clause
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|