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'子句中使用嵌套查詢。 –