Select from dual in T-SQL / SQL Server

Raymond Tang Raymond Tang 1392 0.62 index 5/28/2019

In Oracle database, you can select from dual table if you only want to return a one row result set. In many other databases, the query engine supports select directly from constant values without specifying a table name.

In SQL Server, you can directly select values without specifying a table name.

Code snippet

SELECT "Constant Value" AS COLUMN_NAME;
mssql t-sql

Join the Discussion

View or add your thoughts below

Comments