As seen below the two queries, we find that they both work well. Then I am confused why should we ever use BETWEEN because I have found that BETWEEN behaves differently in d
worse if it's
SELECT id FROM entries WHERE (SELECT COUNT(id) FROM anothertable WHERE something LEFT JOIN something ON...) BETWEEN entries.max AND entries.min;
Rewrite this one with your syntax without using temporary storage.