jpql select into select(jpql select into select)

系统教程 行业动态 更新时间:2024-06-14 16:59:46
jpql select into select(jpql select into select)

可以使用一个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.ID

jpql中这个语句的等价物是什么?

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.ID

what 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.

更多推荐

本文发布于:2023-04-17 08:50:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/dzcp/d85b0ee52c2fb9365b4d9874359149f5.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:jpql   select

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!