|
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]
|