SQL 关键字 Between and,<,> 符号
假如声明表A,有字段a 类型为int,b 字段类型为nvarchar
select * from A where a between 1 and 10
也可以使用大小号,SQL 如下:
select * from A where a>=1 and a<=10
以上SQL就可以查询1-10范围的数据
下面的SQL 是字符串类型的:
select * from A where b between 'b1' and 'b10'
你定义的价格的字段是h_price?
这样写
select * from table where h_price between 1000 and 2000
这个语句的意思是 显示出table这个表中 价格在1000到2000的数据的所有信息
在java中你可以把这个变量通过运算符来表示范围啊 1000<变量名<2000 似乎这样可以吧 我也不太清楚 学的东西都还老师了
你的写法是可以的,把那个字段用两次就可以了