SELECT from nothing?

前端 未结 14 2271
难免孤独
难免孤独 2020-12-24 04:03

Is it possible to have a statement like

SELECT \"Hello world\"
WHERE 1 = 1

in SQL?

The main thing I want to know, is can I SELECT f

14条回答
  •  滥情空心
    2020-12-24 04:57

    Try this.

    Single:

    SELECT *  FROM (VALUES ('Hello world')) t1 (col1) WHERE 1 = 1
    

    Multi:

    SELECT *  FROM (VALUES ('Hello world'),('Hello world'),('Hello world')) t1 (col1) WHERE 1 = 1
    

    more detail here : http://modern-sql.com/use-case/select-without-from

提交回复
热议问题