I need to LEFT JOIN but the "right" table is very large and I only need values after 2018-01-01, while the whole table has records from up to 2012. To speed up my query I therefore need to not LEFT JOIN the full table, but the table with records > 2018-01-01. If I use a where statement at the end of my query it will still use the full table right? How can I do this?
you can put the where filter right in the join.
select * from tableA a
left Join tableB b on a.id=b.id and b.date > 2018-01-01
where a.field =''