DECODE( ) function in SQL Server August 18, 2023 by Tarik You could use the ‘CASE .. WHEN .. THEN .. ELSE .. END’ syntax in SQL.