from (From FlightSchedule as a where a.route.routeId=1) as b
上述查询有什么问题? 它给我这个错误Hibernate查询语法错误?
org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: (near line 1, column 6 [from
(From FlightSchedule as a where a.route.routeId=1) as b]
我试图写它以不同的方式,但不工作。 我认为内部查询应该评估一个对象列表,并且第一个from
令牌应该返回相同的值。 请告诉我我做错了什么? 谢谢。
您的整个查询是怎样的?将From改为From,它们区分大小写。 – Zeus
IN mysql这应该是这样的: select * from(select * from FlightSchedule where routeId = 1)a; –
为什么在这里使用嵌套查询?顺便说一句,如果你想要嵌套查询,嵌套查询应包含'select'子句,并且据我所知你不能在hibernate的'from'子句中使用嵌套查询。 –