/*
SELECT i.default_warehouse_id, w.warehouse_name ,count(*)
FROM `0p4_item` i left join 0p4_warehouse w on w.warehouse_id=i.default_warehouse_id group by `default_warehouse_id`
*/
UPDATE `0p4_item` SET `default_warehouse_id`=2 WHERE `default_warehouse_id`=6;


SELECT u.uom_name, i.keep_stock_uom_id ,count(*)  FROM `0p4_item` i left join 0p4_uom u on u.uom_id=i.`keep_stock_uom_id` group by i.`keep_stock_uom_id`

SELECT i.item_code, u.uom_name FROM `0p4_item` i left join 0p4_uom u on u.uom_id=i.`keep_stock_uom_id` where u.uom_id is null and i.isDeleted=0


UPDATE 0p4_item i
LEFT JOIN 0p4_uom u ON u.uom_id=i.`keep_stock_uom_id`
SET i.keep_stock_uom_id=null
where u.uom_id is null

269


UPDATE swap_test SET x=(@temp:=x), x = y, y = @temp;

UPDATE 0p4_item SET purchase_gl_code_id=(@temp:=purchase_gl_code_id), purchase_gl_code_id = selling_gl_code_id, selling_gl_code_id = @temp

UPDATE  0p4_item i
LEFT JOIN
        0p4_chart_account c
ON      i.selling_gl_code_id = c.chart_account_id
SET     i.selling_gl_code = c.gl_code;

select c.customer_code, c.customer_term_id, t.customer_term_id from 0p4_customer c left join tmp_customer t on t.customer_id=c.customer_id
where c.customer_term_id is not null


UPDATE 0p4_customer c
 INNER JOIN tmp_customer t ON c.customer_id = t.customer_id
SET c.customer_term_id = t.customer_term_id
WHERE c.customer_term_id is not null
