SQL Wybierz, gdzie identyfikator nie istnieje w innej tabeli

where ID not in(select ID from T2 where HISTORY_FLG!=1)
Graceful Grouse