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
https://forums.phpfreaks.com/topic/297344-query-hangs/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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