SQL запрос на возражение с LEFT JOIN

Пытаюсь сделать запрос на возражение, с использованием LEFT JOIN. Правильно ли я понимаю, что такой запрос будет работать только, если данные в БД с одной страницы будет NULL, когда с таблицы слева будут все таблицы.

Реализовал запрос на возражение с использование предиката IN. Вот, если ли у Вас какой-то совет как это можно сделать с LEFT JOIN или все зависит от данных только.

select first_name,last_name
from
  user1
  join employee using (user_id)
  join team_object using (team_id)
  join work1 using (team_object_id)
where
  (start_date,completion_date) not in (
    select start_date, completion_date
    from work1
    where
      start_date between current_date - 30 and current_date
      or
      completion_date between current_date - 30 and current_date
  )

Ответы (2 шт):

Автор решения: Aziz Umarov

Думаю так то так проверьте на своем примере

select first_name,last_name
from
  user1
  join employee using (user_id)
  join team_object using (team_id)
  Left join work1 
 On work1.team_object_id = team_object.team_object_id
  And not (
      start_date between current_date - 30 and current_date
      or
      completion_date between current_date - 30 and current_date
  )
Where work1.team_object_id is not null
→ Ссылка
Автор решения: vp_arth
select first_name,last_name
from
  user1
  join employee using (user_id)
  left join team_object using (team_id)
  left join work1 using (team_object_id)
where work1.id is null -- подходящий work не найден
AND -- отсекаем неподходящие work
  (start_date between current_date - 30 and current_date
  or
  completion_date between current_date - 30 and current_date)
→ Ссылка