I want to fetch the data based on the key_column in the table. I am having a procedure where i am passing the key character. If the key is ‘A’ only those records with key as ‘A’ should get selected . For any other key character other than ‘A’, I need all the records except the rows with the key_Column value ‘A’
sample code:
select * from tab1
where
if (@key_Char = 'A') Then key_Column=@key_Char
ELSE key_Column <>@key_Char
You can try this