Соедините таблицы слева, переместите условие WHERE
относительно столбцов таблицы, соединенных слева, в ON
.
WITH Machines(id, ip_address) as (
values
(1, '1.1.1.1')
,(2, '1.1.1.2')
,(3, '1.1.1.3')
,(4, '1.1.1.4')
),Schedule(id, machine_id, reserved_date, user_id) as (
values
(1, 1, '2019-10-31', 1)
,(2, 2, '2019-10-10', 2)
,(3, 3, '2019-10-31', 4)
)
SELECT machines.ip_address, schedule.user_id
FROM machines
LEFT JOIN schedule ON schedule.machine_id = machines.id
AND schedule.reserved_date = '2019-10-31';
Dbfiddle