This article is tagged with:
Sql select where id not exists in another table
and mysql
sql select where id not exists in another table
where ID not in(select ID from T2 where HISTORY_FLG!=1)