select idpelamar,
case when jk='L' then 'Laki' when jk='P' then 'Perem' end as JENIS
from tblpelamar
it's work, so how to if 'case' statment make as variable like this
declare @jenis nvarchar(1)
declare @perintah nvarchar(100)
set @jenis='L'
set @perintah='case when jk=@jenis then Laki when jk=@jenis then Prem end as JENIS'
select idpelamar,
+@perintah
from tblpelamar