请教一个hibernate hql语句 有一张表product,其中有三个字段,主键id,进货价price1,销售价price2,现在怎么用hibernate 的hql语句写出一个要求得到所有product的结果集,并且要求按照销售价 - 进货价 升序的方式进行排列 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 先建个类:Product.java其中有属性id,price1,price2HQL:from Product p order by p.price2,p.price1 from Product p order by (p.price2 - p.price1) from Product p order by (p.price2- p.price1) 我就不会打了,给个建议你先把标准的SQL自己写出来,然后在考虑什么HQLselect * from t_Product p order by (p.price2- p.price1) 好像和HQL区别不是很大吧OVER 先写SQL,在转换成HQL,SQL和HQL区别不是很大。select * from t_Product p order by (p.price2- p.price1) 转换成HQLfrom Product p order by (p.price2- p.price1) js可以把一个html刷新到div里面吗? 关于泛型类的继承问题 log4j配置文件的加载 问题!!!!!!!!!!!!!! 关于Hibernate连接池的选择问题 如何取得163邮箱通讯录的所有联系人的列表(sid怎样取得),请关注 tomcat一闪就没,而我在MyEclipse中却可以启动运行,这是为什么? rmi 调用问题!!11 我走完strust 后 走到一个米字路口 “Bean not found”??(我是初学者) ***禁止重复登录?*** struts2 web.xml 加上过滤器(为解决中文乱码用)后,请求不到资源。请大家帮忙解决 汇报项目
其中有属性id,price1,price2HQL:
from Product p order by p.price2,p.price1
from Product p order by (p.price2 - p.price1)
你先把标准的SQL自己写出来,然后在考虑什么HQLselect * from t_Product p order by (p.price2- p.price1) 好像和HQL区别不是很大吧OVER
select * from t_Product p order by (p.price2- p.price1)
转换成HQL
from Product p order by (p.price2- p.price1)