HQL:from books b where b.price>'"+Price1+"'";  
 Price1=50  Price2=200
我现在想查大于50小于200的该如何写啊
求帮助

解决方案 »

  1.   

    from books b where b.price>'"+Price1+"' or b.price < '"+Price2+"'";  
      

  2.   

    from books b where b.price>"+Price1+" and b.price<"+Price2+";   
      

  3.   

    其实整条语句是这样的
    select count(*) from books as b,shops as s where a.id=b.id and  b.price>='"+Price1+"'and  b.price<="+Price2+"'";
    前面已经用过where了 后面该如何该啊
      

  4.   

    不是很明白楼主的意图,前面加过WHERE了后面就跟AND不就可以了吗
      

  5.   

    HQL:from books b where b.price between 20 and 200;
      

  6.   

    from Books b where b.price between 50 and 200;
    其中from 后面接好像是要一个对象的名称,Books 要大写的。