I am trying to do what the below pseuedo code infers:
WHERE
CASE
WHEN @test <> '' THEN Agent = @test
ELSE --no where clause
END
What is the correct structure for this?
I am trying to do what the below pseuedo code infers:
WHERE
CASE
WHEN @test <> '' THEN Agent = @test
ELSE --no where clause
END
What is the correct structure for this?
use OR:
select * from yourTable
where @test = '' OR Agent = @test
if @test
coming with null value (instead of ''
), you must use:
select * from yourTable
where @test is null OR Agent = @test