Mathematic Calculations on Fields

Posted on 2011-04-19
Last Modified: 2012-05-11
I have a column in a table that I would like to make some calculations on, I would like to add some percentages to the output..

e.g select price + (10%+5% ) FROM table

The 10% and 5% would each be a percentage of the price to be added back to the price to get the total including the percentages..

Thanks in Advance
Question by:greeneel
    LVL 24

    Accepted Solution

    it can be as follows:
    select (price + (price * 10/100) + (price * 5/100)) FROM table
    LVL 24

    Assisted Solution

    For shorter line:
    select (price + (price * 0.1) + (price * 0.05)) FROM table
    LVL 11

    Author Comment

    hey guys another question, how would I write the statement for calculating something like 6.62% of the price?
    LVL 24

    Expert Comment

    (price * ( 6.62 / 100 ))
    (price * 0.0662)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    More Fun with XML and MySQL – Parsing Delimited String with a Single SQL Statement Are you ready for another of my SQL tidbits?  Hopefully so, as in this adventure, I will be covering a topic that comes up a lot which is parsing a comma (or other…
    Creating and Managing Databases with phpMyAdmin in cPanel.
    This video discusses moving either the default database or any database to a new volume.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now