View previous topic :: View next topic
|
Author |
Message |
madlui56
New User
Joined: 08 Aug 2006 Posts: 61 Location: Philippines
|
|
|
|
How is this done?Is this possible?
I just want to update a specific field in the table wherein I will just have to subtract an amount to that particular field..How is this done?
Such us;
Update table
set table field = (field - 400)
Thanks |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
yep, except for the syntax you have it right. 'Manuals' hyperlink at the very top of this page, then look for an SQL manual to find out the exact syntax for an update. You should include a WHERE clause to insure that you only UPDATE rows that you want and not all rows in the table.
The parenthesis in the SET statement are not required. |
|
Back to top |
|
|
madlui56
New User
Joined: 08 Aug 2006 Posts: 61 Location: Philippines
|
|
|
|
I will find the document you suggested |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Is a negative value valid for "field"?
If not, you would test to make sure that the -400 did not result in a negative value. |
|
Back to top |
|
|
|