【发布时间】:2020-03-09 09:50:48
【问题描述】:
工作表
1.id
2.status = 'active'
3.name
修表
1.repair id
2.job_id
3.process = 'yes|no'
4.status = '1|2'
工作表
id name status
1 test active
2 check active
修表
repair_id job_id process status
1 1 no 2
2 1 no 1
3 1 yes 2
4 2 no 1
5 2 no 2
这里我需要显示按 job_id 分组的数据(process != 'yes' and repair_status != 2)
我需要查询后的结果
---------------------------------------------
job_id name( job.name ) status( job.status )
------------------------------------------------
2 check active
【问题讨论】:
-
到目前为止您尝试过什么?你被困在哪里了?
-
您尝试过的查询在哪里...
-
这能回答你的问题吗? SQL JOIN: Just not able to understand them
标签: mysql sql subquery left-join having-clause