This query takes about a minute to produce results:
SELECT MAX(d.docket_id), MAX(cus.docket_id) FROM docket d, Cashup_Sessions cus
But this one:
SELECT MAX(d.docket_id) FROM docket d UNION MAX(cus.docket_id) FROM Cashup_Sessions cus
gives your results instantly. I do not see what the first does, which will take much more time. I mean, they both just check the same two lists of numbers for the largest and return them. What else could be done that I do not see?
I am using jet SQL in an MS Access database through Java.
sql
Jack
source share