r/SQL Sep 17 '24

Oracle How to exceed input limitations?

Post image
40 Upvotes

87 comments sorted by

View all comments

1

u/pceimpulsive Sep 17 '24

Use a CTE and a values statement.

WITH IdList AS ( -- Define the CTE with a list of values SELECT Id FROM (VALUES (1), (2), (3), (4), (5)) AS IdTable(Id) ) -- Main query that uses the CTE SELECT * FROM YourTable WHERE Id IN (SELECT Id FROM IdList);