One of the reader of the blog has sent me question regarding how to use DECODE function in SQL Server.
SELECT DECODE(Letters, 'First',1, 'Second',2, 'Third',3, 0) AS LN FROM LettersTable
In SQL Server the equivalent code is CASE statement. Here is the examples regarding how DECODE can be written in SQL Server.
SELECT CASE WHEN Letters = 'First' THEN 1 WHEN Letters = 'Second' THEN 2 WHEN Letters = 'Third' THEN 3 ELSE 0 END AS LN FROM LettersTable
Reference: Pinal Dave (http://blog.SQLAuthority.com)