0

I am using an IN clause, whereby, it needs to search the id IN these set of IDs that are not in order, meaning, it came from a different criteria., how to solve this ?

SELECT DISTINCT ID FROM "projeck"."mytable" "t" WHERE staffID IN (75953,196262,196387,133585,195639,196702,195790,195820,192903,145383,179603,175896,176554,43545,154843,183798,195767,195715,etc..etc.. etc..)

and i am getting this oracle error

General error: 1795 OCIStmtExecute: ORA-01795: maximum number of expressions in a list is 1000
sasori
  • 5,249
  • 16
  • 86
  • 138

1 Answers1

0

My first choice would be to reference the function that generates these values directly.

If the values were being used for multiple queries and were expensive to calculate then I'd think about loading them into a global temporary table and joining to it.

David Aldridge
  • 51,479
  • 8
  • 68
  • 96