Jump to content


Photo

Corrent mysql syntax for this minus query?


  • Please log in to reply
1 reply to this topic

#1 dragonusthei

dragonusthei
  • Members
  • PipPipPip
  • Advanced Member
  • 46 posts

Posted 17 October 2006 - 11:05 PM

UPDATE order_numbers SET order_number - 3

doesnt work so how would i update a table and take a number away from a field.

#2 printf

printf
  • Staff Alumni
  • Advanced Member
  • 889 posts

Posted 17 October 2006 - 11:09 PM

UPDATE order_numbers SET order_number - 3

doesnt work so how would i update a table and take a number away from a field.


Just use the column name your subtracting from!

UPDATE order_numbers SET order_number = ( order_number - 3 ) WHERE some_column = some_value


me!










0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users