5

Given a table with the following columns

comment
minAge
maxAge

and the following rows:

comment, minAge, maxAge
"Baby", 1, 5
"Teen", 13, 19
"Adult", 20, 50

Is it possible to do a sql query like:

select * from rows where 16 between minAge and maxAge

With the results:

"Teen", 13, 19
4

1 回答 1

12

BETWEEN运算符选择范围内的值。这些值可以是数字、文本或日期。

在此处自行查看您的表格和数据

于 2013-08-05T17:27:54.727 回答