SQL如下:
select * from Orders o,(select city,addressee,zipcode,[address] from Orders
group by city,addressee,zipcode,[address] having count(*) > 1) t
where o.city = t.city and o.addressee = t.addressee and o.zipcode = t.zipcode and o.[address] = t.[address]像这种select a,b where a.XX = b.XX 的语法可不可以转成HQL?或者有没有别的替代写法?
select * from Orders o,(select city,addressee,zipcode,[address] from Orders
group by city,addressee,zipcode,[address] having count(*) > 1) t
where o.city = t.city and o.addressee = t.addressee and o.zipcode = t.zipcode and o.[address] = t.[address]像这种select a,b where a.XX = b.XX 的语法可不可以转成HQL?或者有没有别的替代写法?
解决方案 »
- 谁帮忙有JAVA、C或C++做个MRP系统感激不尽!
- 关于我做的一个日报系统问题
- eclipse 快捷键 目录展开。。。。。。。
- 个人用户如何申请服务器和域名
- MySql自动增长字段
- 急,Resin中出现Server connection failure during transaction
- 想知道: spring+hibernate到底是一个什么样的组合
- frameset struts
- 深圳项目外包~~~~
- 在struts框架下,怎么自定义sesstion timeout的事件
- 求验证算术表达式的正则表达式--java实现
- struts,form表单中数据无法传递到actionForm中,而且request.getParameter也取不到表单中数据
像这种select a,(select * from b) c where a.XX = c.XX 的语法可不可以转成HQL?或者有没有别的替代写法?
from a where a.xx in (select b.xx from b)
from a where a.xx in (select b.City from b) and a.xx in (select b.xx from b) and a.xx in (select b.xx from b) and a.xx in (select b.xx from b) and a.xx in (select b.xx from b)....
“select a,(select * from b) c where a.XX = c.XX”。在hibernate中表对应的是类,那么在a表对应的这个类中,应该有一个集合List b = new ArrayList();下面你应该知道我干什么了吧:
运用一对多的关系啊:From A,B where A.xx = B.xx;但是你要在配置文件中配置一对多的关系。这样应该是可以的,我晚上回家测试一下,思路应该没什么问题的。