Reputation: 556
In a query I want to present the employee's monthly salary. I want to present a salary of 1500 in the query if the result is below that, if not I want to keep the sum I got in the query.
Anyone know how to do that?
Upvotes: 0
Views: 52
Reputation: 60751
select
case when salary<1500 then 1500 else salary end
, column2
,column3
from mytable
Upvotes: 0
Reputation: 1269873
The basic idea is to use a case
statement. Something like this:
select (case when salary < 1500 then 1500 else salary end) as salary
Upvotes: 2