i have the following sql query
select * from tblArea where AreaDescription in ('Processing1','Geology 66','Site Infrastructure')
currently it shows the records where AreaDescription in ('Processing1','Geology 66','Site Infrastructure')
but i need to pass value to in query which will be always true and show all the records.i know that i can use where clause
where 1=1
but here i need to use the in statement.is it possible?
I don't understand why you need it and why you don't want to add where 1=1
or omit the WHERE
, but you could do it this way:
select * from tblArea
where AreaDescription in
(AreaDescription,'Processing1','Geology 66','Site Infrastructure')
Test: http://sqlfiddle.com/#!3/6e15d/1/0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With