Reply to SQL Error in Update Query

Your name:

Reply:


Posted by Sean Anderson on 04/13/07 18:22

Can anyone see a problem here?

UPDATE POSTAGE SET EXTRA_KG = ITEM_TOTAL_WEIGHT - 8
WHERE ITEM_TOTAL_WEIGHT > 8
AND PURCHASE_ORDER_ID = 1;

I get the following error

You have an error in your SQL syntax; check the manual that corresponds to
your MySQL server version for the right syntax to use near '- 8 WHERE
ITEM_TOTAL_WEIGHT > 8 AND PURCHASE_ORDER_ID = 1' at line 1

From the following table

create table POSTAGE

(

postage_id int NOT NULL AUTO_INCREMENT,

purchase_order_id int,

package_type_id int,

item_total_cost decimal(10,2),

item_total_weight float,

package_max_weight float,

extra_kg float default 0,

primary key (postage_id)

);


With columns values (in order) of 1,1,1,3.49,0.75,16,0



--

Regards,

Sean Anderson

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация