java – JPQL中的多个IN条件
发布时间:2020-12-15 02:22:33 所属栏目:Java 来源:网络整理
导读:如何在JPQL中表达以下SQL: select * from table where ( ( table.col1,table.col2) in (col1val1,col2val1),(col1val2,col2val2),(col1val3,col2val3)) BTW:以上是有效的Oracle SQL语法 解决方法 我的JPQL很糟糕,但是如下: select tableDto from TableDto
如何在JPQL中表达以下SQL:
select * from table where ( ( table.col1,table.col2) in (col1val1,col2val1),(col1val2,col2val2),(col1val3,col2val3) ) BTW:以上是有效的Oracle SQL语法 解决方法
我的JPQL很糟糕,但是如下:
select tableDto from TableDto tableDto where (tableDto.col1 = col1val1 and tableDto.col2 = col2val1) or (tableDto.col1 = col1val2 and tableDto.col2 = col2val2) or (tableDto.col1 = col1val3 and tableDto.col2 = col2val3) 它不漂亮. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |