我有两个表用户和工作订单。现在我需要通过从 users 表字段中过滤来获取 work_orders 结果。
我的以下查询没有返回结果。
SELECT `work_orders`.`id` as id, `work_orders`.`type` as type
, `work_orders`.`title` as title, `work_orders`.`status` as status
, `work_orders`.`publish_date` as publish_date
, `work_orders`.`priority` as priority, `work_orders`.`assigned_to` as assigned_to
, `work_orders`.`client_id` as client_id, `work_orders`.`due_date` as due_date
FROM (`work_orders`)
LEFT JOIN `users`
ON `users`.`id` = `work_orders`.`assigned_to`
WHERE `work_orders`.`status` != 'closed'
AND users.manager_id = '143'
ORDER BY `work_orders`.`id` DESC
LIMIT 30