I have a select query which needs to take clientid as where condition. However, if the clientid=0, then it needs to select all result.
Select * from client where type=1 and clientid=2
if clientid=0 which I pass it from C#
Select * from client where type=1 //and clientid=0 would be taken out
Select * from client where type=1
case when (t.clientid ='0' then '' when t.clientid <> '0' then and t.clientid = '2') order by [id] desc
But, it said Incorrect syntax near the keyword 'case'.