0
請問如何將這個查詢與內部連接轉換?與內部連接相交
(SELECT DISTINCT tables.table_id AS 'Available table ID'
FROM tables, reservation
WHERE tables.table_id = reservation.table_id
AND ((start_time <> ? AND date = ?)
OR (date <> ?))
OR status = 1)
INTERSECT
(SELECT DISTINCT tables.table_id AS 'Available table ID'
FROM tables, reservation
WHERE tables.table_id = reservation.table_id
AND ((start_time <> ? AND date = ?)
OR (date <> ? AND reservation.table_id <> ?))
OR status=1)
此無關的Java。我編輯了這個問題來刪除'Java'標籤,但只是單挑。 – yshavit
希望查詢現在可讀性更高 – JonK
@Strawberry問題標籤爲MySQL,它沒有'INTERSECT'關鍵字。 – Air