If you require a salary of less than 5000 to 2 times, between 5000 and 10000, between 1.5 and 1.2 to 15000, and between 1.1 and

Source: Internet
Author: User
-- If you require a salary of less than 5000 to 2 times, 5000 to 10000, 1.5 to 1.2, and 15000 to 1.1
With t
(Select 5000 sal from dual union all
Select 4000 from dual union all
Select 6000 from dual union all
Select 10000 from dual union all
Select 14000 from dual union all
Select 15000 from dual union all
Select 20000 from dual)
-- Select sal, decode (-1, sign (sal-5000), sal * 2, sign (sal-10000), sal * 1.5, sign (sal-15000 ), sal * 1.2, sal * 1.1) new_sal
Select sal, case when sal <5000 then sal * 2
When sal <1000 then sal * 1.5
When sal <1500 then sal * 1.2
Else sal * 1.1 end new_sal
From t;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.