DatatableBundle icon indicating copy to clipboard operation
DatatableBundle copied to clipboard

Issues when search with aggregation SQL

Open thiennhan2310 opened this issue 8 years ago • 1 comments

When i try to enable search i have this problems ` An exception occurred while executing 'SELECT COUNT(DISTINCT s0_.id) AS sclr_0 FROM shipment s0_ LEFT JOIN delivery_options d1_ ON s0_.deliveryoption_id = d1_.id LEFT JOIN address_book a2_ ON s0_.sender_addressbook_id = a2_.id LEFT JOIN address_book a3_ ON s0_.recipient_addressbook_id = a3_.id LEFT JOIN package p4_ ON s0_.id = p4_.shipment_id LEFT JOIN shipment_status s5_ ON s0_.shipment_status_id = s5_.id WHERE s0_.shipment_number LIKE ? OR s0_.control_number LIKE ? OR s0_.service_type LIKE ? OR d1_.delivery_option LIKE ? OR a2_.first_name LIKE ? OR a3_.first_name LIKE ? OR COUNT(p4.id) LIKE ?_ OR s0_.chargeable_weight LIKE ? OR s0_.grand_total LIKE ? OR s5_.name LIKE ? OR s0_.id LIKE ?' with params ["%%", "%%", "%%", "%%", "%%", "%%", "%%", "%%", "%%", "%%", "%%"]:

SQLSTATE[HY000]: General error: 1111 Invalid use of group function `

As I see that the sql script is generated is wrong when have aggregation. It should be Having COUNT(p4_.id) LIKE ? ...

thiennhan2310 avatar Aug 05 '17 05:08 thiennhan2310

Hello I have the same issue, is it still in trouble for you ?

cravier avatar Sep 25 '17 13:09 cravier