I have a sqlite query that I\'m trying to write. I have two tables:
TableA (sales): id sales date
TableB (goals): id goal date
I\'m selecting from Ta
Just get the cartesian product and then filter out uninteresting rows. Basically:
select a.*, b.* from a, b where not exists ( select null from b b2 where abs(b2.date - a.date) < abs(b.date - a.date) )
I don't know if SQLite supports that, tough.