我这是java查询mysql的问题
数据库中有表: price
id price
1 3元/只
2 4元/只
3 1元/只
4 2.5元/只
7 3元/只
8 5元/只
10 5.5元/只
11 2.3元/只
12 7元/只
14 12元/只
19 13.5元/只
21 16元/只
23 14元/只如何查询price在 3元/只 和 8元/只 范围内的数据啊(数据库里的数据是不能变的了)
用 hibernate怎样写hql语句查询啊????
数据库中有表: price
id price
1 3元/只
2 4元/只
3 1元/只
4 2.5元/只
7 3元/只
8 5元/只
10 5.5元/只
11 2.3元/只
12 7元/只
14 12元/只
19 13.5元/只
21 16元/只
23 14元/只如何查询price在 3元/只 和 8元/只 范围内的数据啊(数据库里的数据是不能变的了)
用 hibernate怎样写hql语句查询啊????
String hql="from price where price.pirce between 3 and 8";
Query queryupdate=session.createQuery(hql);
int ret=queryupdate.executeUpdate();
trans.commit();
给分结帖吧