Thursday, 8 August 2013

Using Case Statement in sqlserver and Changing the datatype of the column for displaying

Using Case Statement in sqlserver

Select Id,Name=case when Name='a' then 'x' else Name end from tbl_Testing

Changing the datatype of the column for displaying

Select Id,convert(decimal(10,2),sal) as sal from tbl_Testing

No comments:

Post a Comment