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.

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

1 Answer 1

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
1
  • 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
    Commented Jul 20, 2016 at 7:34

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