应发工资 > 1300 元部分开始计算所得税
0~ 1300 不用缴税
1300 ~ 1800 按 工资 * 5% -65
1300 ~ 3300 按 工资 * 10% -155
1300 ~ 6300 按 工资 * 15% -320
需求是这样子的,
我的表示这样子的
工资下限,工资上限,扣除数,税率 0.00 1300.00 0.00 0.00
1300.00 1800.00 65.00 0.05
1300.00 3300.00 155.00 0.10
1300.00 6300.00 320.00 0.15求大神教导,写个存储过程,我传入一个工资进去怎么判断传入的工资属于哪个区间,多谢!求详细!
0~ 1300 不用缴税
1300 ~ 1800 按 工资 * 5% -65
1300 ~ 3300 按 工资 * 10% -155
1300 ~ 6300 按 工资 * 15% -320
需求是这样子的,
我的表示这样子的
工资下限,工资上限,扣除数,税率 0.00 1300.00 0.00 0.00
1300.00 1800.00 65.00 0.05
1300.00 3300.00 155.00 0.10
1300.00 6300.00 320.00 0.15求大神教导,写个存储过程,我传入一个工资进去怎么判断传入的工资属于哪个区间,多谢!求详细!
--大概就是这个样子,自已改下就可以了
create or replace procedure p_t(p_sal number)
as
v_shangxian number;
v_xiaxian number;
v_kouchushu number;
v_tax number;
begin
execute immediate 'select 工资下限,工资上限,扣除数,税率 from 你的表 where :1 between 工资下限 and 工资上限'
into v_shangxian,v_xiaxian,v_kouchushu,v_tax
using p_sal;
dbms_output.put_line(v_shangxian);
end;
/
-- Local variables here
i integer;
begin
if i-1300<0 then
dbms_output.put_line('no');
return;
end if;
for item in (select * from 表) loop
if item.上限-i>=0 then
dbms_output.put_line('按这个标准交');
return;
end if;
end loop;
end;我给你写了个匿名块,按照这个根据你的情况修改就好了
-- Local variables here
i integer;
begin
if i-1300<0 then
dbms_output.put_line('no');
return;
end if;
for item in (select * from 表) loop
if item.上限-i>=0 then
dbms_output.put_line('按这个标准交');
return;
end if;
end loop;
end;