firebird icon indicating copy to clipboard operation
firebird copied to clipboard

Simplified SELECT command syntax [CORE1230]

Open firebird-automations opened this issue 18 years ago • 6 comments

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.

firebird-automations avatar Apr 26 '07 08:04 firebird-automations

Modified by: @dyemanov

issuetype: New Feature [ 2 ] => Improvement [ 4 ]

firebird-automations avatar Dec 04 '07 03:12 firebird-automations

Modified by: @dyemanov

Link: This issue is duplicated by CORE1629 [ CORE1629 ]

firebird-automations avatar Dec 04 '07 03:12 firebird-automations

Modified by: @pcisar

Workflow: jira [ 11950 ] => Firebird [ 14842 ]

firebird-automations avatar Jan 28 '08 15:01 firebird-automations

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

firebird-automations avatar Nov 25 '15 20:11 firebird-automations

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.

firebird-automations avatar Nov 25 '15 21:11 firebird-automations

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.

firebird-automations avatar Nov 25 '15 22:11 firebird-automations