I think you want this:
declare @inputString nvarchar(max) = 'eap';
declare @where nvarchar(max) =
case @inputString
when 'dho' then 'data warehousing'
when 'sv' then 'sql serverl'
when 'eap' then 'asp.net'
else ''
end
select * from Table1
where desc = @where
also your request may look like this:
declare @inputString nvarchar(max) = 'dho'
select * from
(select
case [desc]
when 'data warehousing' then 'dho'
when 'sql serverl' then 'sv'
when 'asp.net' then 'aep'
else ''
end
as [newDesc]
from [table])t
where newDesc = @inputString
source
share