2

Basically just started using sql and having a minor problem. Working out the percentage of a number.

Example: What would I need to type in to work out:

2.75 - 5%

Drink_price= 2.75 After 5%discount = 2.61

So I need to deduct 5% of the price as a discount.

Sql doesn't seem to like the '%' key.

  • 3
    Have you checked the word "wildcard"? Should be 2.75 - 2.75 * 0.05 or similar. – Vérace Jul 20 '16 at 7:21
  • 3
    Basic but legitimate question. I don't see any need to close it. – spaghettidba Jul 20 '16 at 8:10
4

This is not really database administration. The way you do it cannot be done in most programming languages too. Calculate the discount as 95% of the drink price:

2.75*0.95
|improve this answer|||||
  • 1
    Oh okay i understand, I was thinking of calculations in the wrong sense. Awesome! Thank you very much and sorry for such a simple question. =) – TSM Jul 20 '16 at 7:34

Not the answer you're looking for? Browse other questions tagged or ask your own question.