Rematch ORDER item renewal

Source: Internet
Author: User
Re-match the Order details of a product without renewal because the product is not downloaded. Once again, the MySQL update and delete scripts have many restrictions, which embarrass the unqualified programmers.

Create Table tmp201409162227 as select L. po_line_id, PT. product_code from trade T, po_header P, po_line L, product PT where T. shop_id = 3456 and T. pay_time> = '2017-09-16 00:00:00 'and T. pay_time <= '2014-09-16 23:59:59 'and T. trade_id = P. trade_id and P. po_header_id = L. po_header_id and L. num_iid = pt. num_iid and (t. trade_status = 'wait _ buyer_confirm_goods 'or T. trade_status = 'wait _ seller_send_goods ') and L. product_code = ''; update po_line lll set lll. product_code = (select TM. product_code from tmp201409162227 TM where TM. po_line_id = lll. po_line_id) Where lll. po_line_id in (select TT. po_line_id from tmp201409162227 TT );

 

Rematch ORDER item renewal

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.