Simplified SELECT command syntax [CORE1230]
Submitted by: Alexander Tyutik (tut)
Is duplicated by CORE1629
Votes: 2
People very often need quersied wich return single record. For this proposes people use queries like this:
SELECT CURRENT_USER FROM RDB$DATABASE;
I think it nothing bad to take good ideas from adversaries. So, in MS SQL there are simplified syntax for this:
SELECT CURRENT_USER;
It is very convenient.
Modified by: @dyemanov
issuetype: New Feature [ 2 ] => Improvement [ 4 ]
Modified by: @pcisar
Workflow: jira [ 11950 ] => Firebird [ 14842 ]
Commented by: @ArnoBrinkman
IMO this would indeed be very usefull.
When the FROM clause is omitted it must be seen as a "FROM DummyStream" where DummyStream holds only 1 record and no fields
SELECT Count(*) for example will result in 1
SELECT * FROM (SELECT 1 AS AField UNION ALL SELECT 2 UNION ALL SELECT 4 UNION ALL SELECT 8) dt => results in a list AField ------- 1 2 4 8
Commented by: @dyemanov
The standard declares this differently: "values (current_user)" instead of "select current_user". I.e. it's not a SELECT at all. And surely COUNT() is prohibited there.
Commented by: @ArnoBrinkman
I see VALUES () as another feature request
While "SELECT <select list> [<table expression>]" is used also by other SQL engines i see the use of it.