Select from dual in T-SQL / SQL Server

visibility 324 access_time 3 years ago languageEnglish

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;
info Last modified by Raymond 3 years ago copyright This page is subject to Site terms.

Please log in or register to comment.

account_circle Log in person_add Register

Log in with external accounts

timeline Stats
Page index 0.30
More from Kontext
Calculate time difference in T-SQL / SQL Server
visibility 107
thumb_up 0
access_time 3 years ago
Convert string to date in T-SQL / SQL Server
visibility 371
thumb_up 0
access_time 3 years ago