411 REFERENCE · Wikibooks
SQL Dialects Reference/Select queries/Select without tables
Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.
Select without tables
Sometimes one needs to execute SQL scalar expressions without table context, i.e. make a query that would act as normal SELECT operator, evaluate given comma-separated expressions and return a table with single row and one or multiple columns (one for every individual expression). Obviously, expressions can't reference any columns from the tables, as there are none.
An example is determining the value of a mathematical function, using Oracle syntax:
SQL> select 4*atan(1) as "Arc tangent of 1 times 4" from dual;
Arc tangent of 1 times 4
------------------------
3.14159265
VALUES
SELECT expressions FROM sysibm.sysdummy1 SELECT expressions FROM rdb$database SELECT expressions SELECT expressions
SELECT expressions
SELECT expressions FROM dual
VALUES row_constructor_list
SELECT expressions
VALUES (expressions)
SELECT expressions
VALUES ("expressions") SELECT expressions FROM dual
SELECT expressions
sql-values.html VALUES (expressions)
SELECT expressions
VALUES ("expressions")