On 15 Sep 2016, at 9:46pm, David Raymond <david.raym...@tomtom.com> wrote:

> The idea is to find the closest date that matches that couldn't be matched to 
> another record.

[snip]

> Can this join be done in SQL?

I wouldn't even try to do it in any SQL engine.  It would be ridiculously 
difficult to debug.  Even "the closest date that matches that couldn't be 
matched to another record" by itself requires processing every row of a table 
using a metric you haven't defined.

If I did do it I'd use multiple parses.  One parse to work out the matching key 
values for each table and store them in another column of the table, the final 
parse to do the LEFT JOIN query.

But your question is phrased not in terms of set operations SQL implements but 
in terms of a standard procedural programming language, so perhaps you should 
use one.  Sooner or later you're going to have to do some programming.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to