一个orm框架下的大数据查询问题

yupeng103 2010-09-19 02:22:26
本人用jpa框架,查询语句如select * from table where a in (?1),但是in中的参数超过了jpa规定的最大参数个数2000个,在线求救!!!
...全文
112 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
喜-喜 2010-09-20
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 yupeng103 的回复:]
顶起~~
[/Quote]

用 or 多连接几个 in ,可以么...
yupeng103 2010-09-19
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 budong0000 的回复:]

把in里的东西写成表,再join SQL code

;with cte(text) as(
select 'aaa' union all
select 'bbb' union all
)
select col1,col2...
from table t
inner join cte c
on t.text = c.text



你问题是字符串长度?
可以依次取少量字符串 再搜索呀,最……
[/Quote]

我用的是jpa框架,不支持union
budong0000 2010-09-19
  • 打赏
  • 举报
回复
把in里的东西写成表,再join

;with cte(text) as(
select 'aaa' union all
select 'bbb' union all
)
select col1,col2...
from table t
inner join cte c
on t.text = c.text


你问题是字符串长度?
可以依次取少量字符串 再搜索呀,最好再把结果union 起来

27,580

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server 应用实例
社区管理员
  • 应用实例社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧