display sum of three columns

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kkshansid
    New Member
    • Oct 2008
    • 232

    display sum of three columns

    i want to make a column in mysql table which display sum of three columns.is it possible?how?
    eg
    a table with column
    price1
    price2
    price3
    totalprice
    after inserting 3 prices total price column will get automatically filled
  • Atli
    Recognized Expert Expert
    • Nov 2006
    • 5062

    #2
    Hey.

    That would be redundant; a waste of space. You can get the total price using a fairly cheap calculation in your queries. - Is there any specific reason why you want to do this?

    And yes, you can of course do this, but the trouble isn't really worth it. It would involved procedures and/or triggers.

    Comment

    Working...