>>If you're looking into a query from table1 where you don't have rows with today's day and field2 = 'ABC' in the second table, then use NOT EXISTS subquery, e.g.
>>
>>select * from Table1 T1 where not exists (select 1 from Table2 T2 where T2.id_field = T1.id_field
>> and CAST(T2.date_fld as date) = cast(CURRENT_TIMESTAMP as date)
>>and T2.field2 = 'ABC')
>
>Without testing, intuitively I think that this one would be faster. Thank you.
If you only need rows from Table1 which satisfy the condition of not having corresponding rows in table2 with today's date and particular value of the field2, then this is the query you should use. It is fast and the other one has different meaning.
If it's not broken, fix it until it is.
My Blog