Home Forums SQL Server 2005 T-SQL (SS2K5) How to write Conditional Where Clause RE: How to write Conditional Where Clause
Pyay Nyein
Mr or Mrs. 500
Points: 565
More actions
June 17, 2009 at 9:17 am
#1011045
Hi,
Half of the code is already in your question..change the and/or in the where clause according to ur requirement
SELECT[name]
FROMtableInfo
WHERE(@x 0 and @x is not null and x = @x)
and/or(@y 0 and @y is not null and y = @y)