How to select multiple rows filled with constants?

后端 未结 15 993
夕颜
夕颜 2020-11-29 17:08

Selecting constants without referring to a table is perfectly legal in an SQL statement:

SELECT 1, 2, 3

The result set that the latter retu

15条回答
  •  北海茫月
    2020-11-29 17:38

    Oracle. Thanks to this post PL/SQL - Use "List" Variable in Where In Clause

    I put together my example statement to easily manually input values (being reused in testing an application by testers):

    WITH prods AS (
        SELECT column_value AS prods_code 
        FROM TABLE(
            sys.odcivarchar2list(
                'prod1', 
                'prod2'
            )
        )
    )
    SELECT * FROM prods
    

提交回复
热议问题