sábado, 7 de febrero de 2015

mySQL select IN range


Is it possible to define a range for the IN part of the query, something like this
SELECT job FROM mytable WHERE id IN (10..15);
Instead of
SELECT job FROM mytable WHERE id IN (10,11,12,13,14,15);
shareimprove this question

1 Answer

up vote 28 down vote accepted
You can't, but you can use BETWEEN
SELECT job FROM mytable WHERE id BETWEEN 10 AND 15
shareimprove this answer

No hay comentarios:

Publicar un comentario