I have a database with a table “Bill” like this:
ID | Name | Money
1 | A | 100
2 | B | 150
3 | C | 200
I want to create a procedure that return me data like this:
ID | Name | Money | Tax | Total
1 | A | 100 | 10 | 110
2 | B | 150 | 15 | 165
3 | C | 200 | 20 | 220
with Tax = (Money*10)/100
and Total = Money + Tax
How can I do this. I’m using sql server 2008
You can use the following:
See SQL Fiddle with Demo
Result: