Is there a performance difference between using a BETWEEN clause or using <= AND >= comparisons?
i.e. these two queries:
SELECT *
FROM table
Actually it depends on your DBMS engine.
Some database management systems will compute twice your expression (once for each comparison), and only once when you use BETWEEN.
Actually if the expression can have a non-deterministic result BETWEEN will have a different behaviour, compare the following in SQLite:
WHERE RANDOM() BETWEEN x AND y -- one random value generated
WHERE RANDOM() >= x AND RANDOM() <= y -- two distinct random values generated
This can be very time consuming if your expression is (for example) a subquery.