| | |
Substract two field values to insert the result into a third value
Please support our MySQL advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
in one query:
I think this should work.
(everytime you update/change a value of field1/field2 you will have to do this query, mysql can't do this automatic..)
MySQL Syntax (Toggle Plain Text)
UPDATE table SET field3 = field1-field2
I think this should work.
(everytime you update/change a value of field1/field2 you will have to do this query, mysql can't do this automatic..)
Last edited by Kruptein; Sep 28th, 2009 at 7:10 am.
![]() |
Similar Threads
- Multi-Line List Field with Values, PHP, and mySQL (PHP)
- How to query from two tables (sum up field values) (MySQL)
- batch insert in gridview (ASP.NET)
- FileMaker HELP (MS Access and FileMaker Pro)
- Insert form values to database and redirect to self with the values still present (PHP)
- jsp code to send values to database (JSP)
- iterating arrays. (VB.NET)
- Access INSERT problem (MS Access and FileMaker Pro)
Other Threads in the MySQL Forum
- Previous Thread: help with mysql SELECT statement
- Next Thread: Columns addition
| Thread Tools | Search this Thread |
agplv3 alfresco amazon api artisticlicense aws bizspark breathalyzer camparingtocolumns changingprices cmg communityjournalism contentmanagement contractors copyright count court crm data database design developer development distinct drupal dui ec2 email enter enterprise eudora facebook form foss gartner gnu government gpl greenit groklaw groupware hiring hyperic images joebrockmeier join journalism keyword keywords kickfire laptop law legal license licensing linux maintenance managing mariadb matchingcolumns metron micromanage microsoft microsoftexchange mindtouch montywidenius mozilla multiple music mysql mysqlcolumnupdating mysqldatetimeordermax() mysqlindex mysqlinternalqueries mysqlquery mysqlsearch news open-xchange opendatabasealliance opengovernment opensource penelope php priceupdating query referencedesign reorderingcolumns resultset saas select sharepoint simpledb sourcecode spotify sql syntax techsupport thunderbird transparency virtualization





