Trying to figure how how to replace the following, with equivalent left outer join:
select distinct(a.some_value)
from table_a a, table_b b
where a.id = b.a_
Here's what my brain puts out after a beer:
select distinct
a.some_value
from
table_a a
join table_b b on a.id = b.a_id
where
b.some_id = 123
and b.create_date < '2014-01-01'
and b.create_date >= '2013-12-01'
and not exists (
select
a2.some_value
from
table_a a2
join table_b b2 on a2.id = b2.a_id
where
b2.some_id = 123
and b2.create_date < '2013-12-01'
)
Whether this'll optimize to faster than a left join or not is something I can't think of right now...