处理oracle sql 语句in子句中(where id in (1, 2, …, 1000, 1001)),如果子句中超过1000项就会报错。
要解决此问题,可以用 where id (1, 2, …, 1000) or id (1001, …)
前提:in中不是临时表的数据,而是通过java代码拼接的, 以逗号分隔的字符串。如:“1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21”
public class Demo {
public static void main(String[] args) {
Demo demo = new Demo();
String str = "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21";
demo