本文介绍了存放所得税的程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要sql商店程序/功能按照以下平板获得所得税



hi i need the sql store procedure/ function to get income tax as per following slab

Up to Rs.2,50,000	No Tax
Rs.2,50,000 - Rs.5,00,000	5%
Rs.5,00,000 - Rs.10,00,000	20%
Rs.10,00,000 and beyond	30%





我的尝试:



i有尝试多个if if但是它不起作用



What I have tried:

i have tried multiple if else but it not work

推荐答案


DECLARE @Income INT = 700000;
DECLARE @TaxPercentage INT = 0;

IF(@Income < = 250000)
	SET @TaxPercentage = 0;
ELSE IF(@Income > 250000 AND @Income <= 500000)
	SET @TaxPercentage = 5;
ELSE IF(@Income > 500000 AND @Income <= 1000000)
	SET @TaxPercentage = 20;
ELSE IF( @Income > 1000000)
	SET @TaxPercentage = 30;

SELECT @Income, @TaxPercentage


这篇关于存放所得税的程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-24 23:05