How to select multiple rows filled with constants?

后端 未结 15 1054
夕颜
夕颜 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:48

    In Oracle

    SELECT
      CASE
        WHEN level = 1
        THEN 'HI'
        WHEN level = 2
        THEN 'BYE'
      END TEST
    FROM dual
      CONNECT BY level <= 2;
    

提交回复
热议问题