首先,我通过职位阅读,名字相匹配,我尝试把一些解决办法结合起来,但我似乎可以让这席文工作......。
问题似乎围绕《公约》第8条的职能。
这里就是这样。
SELECT `purchase_orders`.`purchase_order_id`,`purchase_orders`.`sequence_id`,`purchase_orders`.`order_number`,`vendors`.`name`,`purchase_orders`.`date`,COUNT(`purchase_order_items`.`purchase_order_id`) `item_count`,`purchase_orders`.`total_value`,`purchase_orders`.`status`,`users`.`first`
FROM (`purchase_orders`, `vendors`, `purchase_order_items`,`users`)
WHERE `purchase_orders`.`aid`= c4ca4238a0b923820dcc509a6f75849b AND`purchase_orders`.`vendor_id`=`vendors`.`vid`AND`purchase_orders`.`created_by`=`users`.`uid`AND`purchase_order_items`.`purchase_order_id`=`purchase_orders`.`purchase_order_id` AND `purchase_orders`.`purchase_order_id` LIKE %122%
OR `purchase_orders`.`aid`= c4ca4238a0b923820dcc509a6f75849b AND`purchase_orders`.`vendor_id`=`vendors`.`vid`AND`purchase_orders`.`created_by`=`users`.`uid`AND`purchase_order_items`.`purchase_order_id`=`purchase_orders`.`purchase_order_id` AND `purchase_orders`.`sequence_id` LIKE %122%
OR `purchase_orders`.`aid`= c4ca4238a0b923820dcc509a6f75849b AND`purchase_orders`.`vendor_id`=`vendors`.`vid`AND`purchase_orders`.`created_by`=`users`.`uid`AND`purchase_order_items`.`purchase_order_id`=`purchase_orders`.`purchase_order_id` AND `purchase_orders`.`order_number` LIKE %122%
OR `purchase_orders`.`aid`= c4ca4238a0b923820dcc509a6f75849b AND`purchase_orders`.`vendor_id`=`vendors`.`vid`AND`purchase_orders`.`created_by`=`users`.`uid`AND`purchase_order_items`.`purchase_order_id`=`purchase_orders`.`purchase_order_id` AND `vendors`.`name` LIKE %122%
OR `purchase_orders`.`aid`= c4ca4238a0b923820dcc509a6f75849b AND`purchase_orders`.`vendor_id`=`vendors`.`vid`AND`purchase_orders`.`created_by`=`users`.`uid`AND`purchase_order_items`.`purchase_order_id`=`purchase_orders`.`purchase_order_id` AND `purchase_orders`.`date` LIKE %122%
OR `purchase_orders`.`aid`= c4ca4238a0b923820dcc509a6f75849b AND`purchase_orders`.`vendor_id`=`vendors`.`vid`AND`purchase_orders`.`created_by`=`users`.`uid`AND`purchase_order_items`.`purchase_order_id`=`purchase_orders`.`purchase_order_id` AND COUNT(`purchase_order_items`.`purchase_order_id`) LIKE %122%
OR `purchase_orders`.`aid`= c4ca4238a0b923820dcc509a6f75849b AND`purchase_orders`.`vendor_id`=`vendors`.`vid`AND`purchase_orders`.`created_by`=`users`.`uid`AND`purchase_order_items`.`purchase_order_id`=`purchase_orders`.`purchase_order_id` AND `purchase_orders`.`total_value` LIKE %122%
OR `purchase_orders`.`aid`= c4ca4238a0b923820dcc509a6f75849b AND`purchase_orders`.`vendor_id`=`vendors`.`vid`AND`purchase_orders`.`created_by`=`users`.`uid`AND`purchase_order_items`.`purchase_order_id`=`purchase_orders`.`purchase_order_id` AND `purchase_orders`.`status` LIKE %122%
OR `purchase_orders`.`aid`= c4ca4238a0b923820dcc509a6f75849b AND`purchase_orders`.`vendor_id`=`vendors`.`vid`AND`purchase_orders`.`created_by`=`users`.`uid`AND`purchase_order_items`.`purchase_order_id`=`purchase_orders`.`purchase_order_id` AND `users`.`first` LIKE %122%
GROUP BY `purchase_orders`.`purchase_order_id`
ORDER BY `purchase_orders`.`purchase_order_id` ASC
LIMIT 0,1