Tuesday, 13 August 2013

Sql query by using decode to show grades of employee

Sql query by using decode to show grades of employee

I have a Table "Emp" as following

I want to add another column describing the grades of all employees where
Sal > 100 is 'G1', Sal > 200 is 'G2', Sal > 300 is 'G3', Rest all as 'NA'

I want to use Decode command to solve this. Please help me with the SQL query

No comments:

Post a Comment