In Mysql. How to check exist or not records in table related to other table?

If you need to find all records on one table related to other which have no related records in ohter table

mysql request:

SELECT `contract_uid` FROM `_jomres_contracts`  WHERE `date_range_string` LIKE '%2024/05%' AND `contract_uid` NOT IN (SELECT DISTINCT(`contract_uid`) from `_jomres_room_bookings`)

Метаданные статьи

Идентификатор статьи:
118
Категория:
Дата добавления:
17.11.2023 23:55:19
Просмотры:
74
Рейтинг (Голоса):
(0)

Связанные статьи