可以使用一个select的结果作为另一个(换句话说:upper)select语句的表。 在jpql中有相同的东西
这是我的示例sql语句
SELECT X.NAME, SLS.TOTAL AS BENEFIT (SELECT * FROM PERSON) X INNER JOIN SALESMAN SLS ON SLS.PERSON_ID = X.IDjpql中这个语句的等价物是什么?
it is possible to use one select's results as a table for another(in other word: upper) select statement. is there equivalent in jpql
Here is my sample sql statements
SELECT X.NAME, SLS.TOTAL AS BENEFIT (SELECT * FROM PERSON) X INNER JOIN SALESMAN SLS ON SLS.PERSON_ID = X.IDwhat is the equivalant this statement in jpql?
最满意答案
不,这是不可能的。 子查询只能在WHERE和HAVING子句中使用,如JPA 2.0规范中所述:
子查询可以在WHERE或HAVING子句中使用。[58] ... [58]子查询仅限于此版本中的WHERE和HAVING子句。 在本规范的更高版本中将考虑对FROM子句中的子查询的支持。
同样在JPA 2.1中,这一点没有改变。
No, it is not possible. Subqueries can only be used in WHERE and HAVING clauses, as told in JPA 2.0 specification:
Subqueries may be used in the WHERE or HAVING clause.[58] ... [58] Subqueries are restricted to the WHERE and HAVING clauses in this release. Support for subqueries in the FROM clause will be considered in a later release of this specification.
Also in JPA 2.1 this has not been changed.
更多推荐
发布评论