When this MySql query is executed:
update order_line_item oli
inner join orders o
set oli.active_orders = o.valid
where oli.order_id = o.id
I keep getting this error:
SQL Error (1292): Truncated incorrect DOUBLE value: '6893Order '
Any suggestions?
Additional Info:
- Both "active_orders" and "valid" are INT
- order_line_item can reference the same order.id for multiple lines
Table examples (currently)
table : order_line_item id order_id active_orders 1 1 2 2 3 3 4 4 5 4 table : orders +-------+-------------+ | id | valid | +-------+-------------+ | 1 | 1 | | 2 | 1 | | 3 | 0 | | 4 | 1 | | 5 | 1 | +-------+-------------+
With the query i'm trying to copy orders.valid and paste into orders_line_item.active_orders:
table : order_line_item +-------+------------+-----------------+ | id | order_id | active_orders | +-------+------------+-----------------+ | 1 | 1 | 1 | | 2 | 2 | 1 | | 3 | 3 | 0 | | 4 | 4 | 1 | | 5 | 4 | 1 | +-------+------------+-----------------+ table : orders +-------+-------------+ | id | valid | +-------+-------------+ | 1 | 1 | | 2 | 1 | | 3 | 0 | | 4 | 1 | | 5 | 1 | +-------+-------------+