Saturday, 7 August 2010

Case Select (SQL)

Berikut adalah contoh query menggunakan case select :

select id,fullname,salary,overtime,
case
when salary <5000000 then 1.00*salary
when salary <10000000 then 0.5*salary
when salary >10000000 then 0.25*salary
end as bonus
from salary order by id

semoga bermanfaat...