0

The situation here is different from theirs.When I use the sql to query database:

SELECT A.FREPDATAID AS ID, A.* FROM FMIS_TOP.trdatadetail5250 A WHERE ( 
FREPDATAID IN ('value1','value2'...'value901') OR 
FREPDATAID IN ('value902','value903'...'value1802') OR
...
FREPDATAID IN ('value152270','value152271'...'value152281'))

I control the values in the in statement to be within 1000. and i got

ORA-00913: too many values.

so what should i do?

Barbaros Özhan
  • 59,113
  • 10
  • 31
  • 55
xufan
  • 1
  • 1
  • Does this answer your question? [SQL Error: ORA-00913: too many values](https://stackoverflow.com/questions/18737369/sql-error-ora-00913-too-many-values) – Milgo Oct 21 '20 at 06:17
  • Put those values in a (temporary) table. Then do `... WHERE FREPDATAID IN (SELECT ... from temptab)`. – jarlh Oct 21 '20 at 06:23
  • *I control the values in the in statement to be within 1000.* - wow, probably better to insert these values into a table and to do a join – Scary Wombat Oct 21 '20 at 06:23
  • See [this](https://asktom.oracle.com/pls/apex/f?p=100:11:::::P11_QUESTION_ID:9530196000346534356) discussion on AskTom. There seems to be some limit of values even if you split in 1000 buckets – Marmite Bomber Oct 21 '20 at 09:35

0 Answers0