I choose this:
1. SELECT x.id, y.id, z.id, w.id, s.id FROM x, z, y, w, s ORDER BY x.id DESC, y.id DESC, z.id DESC, w.id DESC, s.id DESC limit 1
2. or through SELECT MAX(x.id) ...
The problem is that the sample without DESC
takes 0.001 seconds, but with DESC
first version is 35 seconds, and the second 15 seconds ...
And here I thought that I needed help. I looked in the direction of JOIN
, but did not understand how to attach it here. I do not need to compare anything, just get the latest entries from each of the tables.