0

有没有办法为 IN 的子句提供一个未定义的集合?

如:

select * from ABC WHERE MY_ID IN (X TO Y)

示例:如果我给 X 给 3 和 Y 给 8 ;

select * from ABC WHERE MY_ID IN (3, ... , 8)

这应该等同于:

select * from ABC WHERE MY_ID IN (3, 4, 5, 6, 7, 8)
4

3 回答 3

6

你需要这个

select * from ABC WHERE MY_ID between 3 and 8
于 2013-01-10T15:27:15.480 回答
2

这个也可以试试。。。

select * from abc where id >= 3 and id <=8
于 2013-01-10T15:42:02.653 回答
1

怎么样BETWEEN

SELECT * FROM ABC WHERE MY_ID BETWEEN 3 AND 8
于 2013-01-10T15:27:26.317 回答