我在推进中遇到 groupBy 问题:
问题属于两个表。一种称为显示,另一种称为customerDisplayType。在 customerDisplayType 表中有两列“驱动程序”和“驱动程序选项”。我想在这两列上进行分组。因此结果可能如下所示:
Display1 -> with customerDisplayType driver "1" and driverOptions "xyz"
Display2 -> with customerDisplayType driver "1" and driverOptions "abc"
Display3 -> with customerDisplayType driver "2" and driverOptions "xyz"
我希望你知道我的意思...
到目前为止,我尝试过这样的事情:
$displays = PiDisplayQuery::create()
->filterByStationId($_object->getId())
->usePiCustomerDisplayTypeQuery()
->groupBy("CONCAT ".PiCustomerDisplayTypePeer::DRIVER.",".PiCustomerDisplayTypePeer::DRIVER_OPTIONS) // I also tried UNION instead of CONCAT
->endUse()
->find();
我该如何解决?