SELECT CASE WHEN TYPE= 'Y' THEN Vlsino WHEN TYPE= 'X' THEN '' END as Vlsino, TypeFROM TableName
Mark This Response as Answer -- Chandu http://www.dotnetfunda.com/images/dnfmvp.gif
DECLARE @Table TABLE( Vlsino varchar(30) NOT NULL, type varchar(30) NOT NULL ); INSERT @Table values('123A','X')INSERT @Table values('345T','X')INSERT @Table values('678Y','Y')INSERT @Table values('980T','Y')SELECT CASE [type] WHEN 'X' THEN 'X' ELSE Vlsino END 'Vlsino', CASE [type] WHEN 'X' THEN '' ELSE [type] END 'type'FROM @Table
Login to post response