Hello All, I need to generate a simple script according to the following: "Using only one update write query to update a salary by 10% for salaries below 100k and 15% for salaries above 100k"
TIA
grin2dan
0
Newbie Poster
Recommended Answers
Jump to Postupdate employee set salary = salary*(case when salary < 100000 then 1.5 when salary > 100000 1.1 else 1 end);
You can use a CASE ... END stament for address the factor of multiplie salary. And when the salary = 100.000 exactly? Well in this case the …
All 3 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.