I would like you to help me with this query, I want the costs that are greater than 1000 to show me in another column increased to 10%.
At the moment I only have:
SELECT * FROM tarifa
The result is the following:
I hope you can help me.
I suppose that when you say that the costs are greater than 1000 you mean that the price + tax is greater than 1000. The following code shows you the total price plus 10% of its value of the results whose prices + rates are greater than 1000 and shows them in a table called "Price_Total"
SELECT (1.10*precio) AS "Precio_Total" FROM tarifas where (precio + impuesto)> 1000
If the cost is simply the price without adding the tax the code would be the following:
SELECT (1.10*precio) AS "Precio_Total" FROM tarifas where precio > 1000
You do not need to use Transact SQL (use of if
/ else
, for example) to display the results.