But won't that take just as long as any other queries? Or will it be
speeded up because all the matching records would be adjacent to each other
-- like all at the end?
You can order the result data set by timestamp in descending order, so the
latest will come up first, i.e., LIFO.
Your suggestion seems more elegant. However, you missed the mathematical
meaning of BETWEEN in SQL:
it is inclusive of both lower and upper bounds.
In the case raised by Patrice Olivier-Wilson, when an announcement expires
on announcements_expiredate, it should not show on that date, and
It is inherent in your naming.
As long as your alias time is the same as the column name time, MySQL
will have no way to distinguish which one you refers to exactly in your
order-by clause, and chooses the alias in the select-clause as the one you
intended. You confused MySQL.
First, why you have