我有這個查詢,我試圖從修訂計劃中選擇所有必須在本月完成的設備,如果我沒有爲該設備製作服務表。我想要做這樣的事情:在where子句中使用select中的計數
select revision_planning.id_echip as echip_id
from revision_planning
inner join service_sheet on echip_id=service_sheet.id_echip
where revision_planning.next_rev_date between '2016-10-01' and '2016-10-31'
and count (select * from service_sheet
where echip_id=service_sheet.id_echip
and service_sheet.`data`between '2016-10-01 00:00:00'and '2016-10-31 23:59:18') = 0
and revision_planning.employee_name='first_last_name'
我爲COUNT = 0檢查聲明使用MySQL。 –