Jump to content

Query Hangs


gmundt

Recommended Posts

I am wondering why the following query just spins in MySQL Workbench.

 

 

SELECT ORD_Item, ORD_Desc, ORD_Item_Class, SUM(ORD_Qty), SUM(ROUND(ORD_Qty*ORD_Price,2)), `pos_item_descriptions`.ITEM_Desc FROM pos_ord_headers STRAIGHT_JOIN pos_ord_lines ON `pos_ord_headers`.`ORD_ID`=`pos_ord_lines`.`ORD_ID` LEFT JOIN pos_item_descriptions ON `pos_ord_lines`.`ORD_Item`=`pos_item_descriptions`.`ITEM_Number` WHERE `pos_ord_headers`.`ORD_Store`="0022" AND  pos_ord_headers.ORD_Date BETWEEN"2015-06-01" AND "2015-06-30" AND pos_ord_lines.ORD_Item_Class IN ("Baskets") GROUP BY ORD_Item

 

This query works:

 

 

SELECT ORD_Item, ORD_Desc, ORD_Item_Class, SUM(ORD_Qty), SUM(ROUND(ORD_Qty*ORD_Price,2)), `pos_item_descriptions`.ITEM_Desc FROM pos_ord_headers STRAIGHT_JOIN pos_ord_lines ON `pos_ord_headers`.`ORD_ID`=`pos_ord_lines`.`ORD_ID` LEFT JOIN pos_item_descriptions ON `pos_ord_lines`.`ORD_Item`=`pos_item_descriptions`.`ITEM_Number` WHERE `pos_ord_headers`.`ORD_Store`="0022" AND  pos_ord_headers.ORD_Date BETWEEN"2015-06-01" AND "2015-06-30" AND pos_ord_lines.ORD_Item_Class IN ("Ice Cream") GROUP BY ORD_Item

 

And the only difference is the different class selection.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

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

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.