2006/04/14

MySQL - 補上明細中的廠商編號

利用主檔的廠商編號,更新明細中沒有紀錄到廠商編號的資料:
UPDATE pos_item AS PI, book_main AS BK SET PI.suppid=BK.suppid WHERE PI.bookid=BK.id AND PI.suppid=0 AND BK.suppid<>0;
UPDATE pos_goods AS PI, goods_main AS BK SET PI.suppid=BK.suppid WHERE PI.goodsid=BK.id AND PI.suppid=0 AND BK.suppid<>0;

沒有留言:

張貼留言