Re: Rewrite a WHERE clause
- From: dsfsdfs878@xxxxxxxxxxxxx
- Date: 30 Aug 2005 03:43:31 -0700
just add "= 1" to the end
here is a working example:
where (case when @arg is null then
case when
[property_id] = 1 //put your test when @arg is null here
then 1 else 0 end
else
case when
[property_id] = 2 //and your other one here
then 1 else 0 end
end) = 1
.
- Follow-Ups:
- Re: Rewrite a WHERE clause
- From: Morgan Bachu
- Re: Rewrite a WHERE clause
- References:
- Rewrite a WHERE clause
- From: joshsackett
- Rewrite a WHERE clause
- Prev by Date: Re: Can @@ROWCOUNT return NULL?
- Next by Date: SQl server processors and threads
- Previous by thread: Re: Rewrite a WHERE clause
- Next by thread: Re: Rewrite a WHERE clause
- Index(es):