Given the following table in SQL Server 2005:
ID Col1 Col2 Col3 -- ---- ---- ---- 1 3 34 76 2 32 976 24 3 7
Both this question And this question try to answer this.
The recap is that Oracle has a built in function for this, with Sql Server you are stuck either defining a user-defined-function or using case statements.