Jump to content

Help with MySQL - join order inventory to order summary with conditions

Recommended Posts

I need help thinking in MySQL - working in phpMyAdmin.

I want to create a query to:

  • join order_inventory to order_summary by the order number
  • use all of the order_inventory columns but also add the status column from order_summary (where status = processing)
  • filter the list to show only products that DO NOT contain 2021 in the product name

Share this post

Link to post
Share on other sites


SELECT S.`status`, I.* FROM CubeCart_order_summary AS S
LEFT JOIN CubeCart_order_inventory AS I
USING (cart_order_id)
WHERE S.`status` = 2
AND I.`name` NOT LIKE '%2021%';

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...