patternsqlMinor
What is the name of the part between SELECT and FROM in a SQL query?
Viewed 0 times
thewhatsqlpartquerybetweennameandselectfrom
Problem
I am trying to find the right description for the parts of a query:
To make my questions more clear:
In Postgres I could use a JSON function, e.g.
or doing this
If I have to tell somebody that this function can be used within the
- What is the name of the part between
SELECTandFROM? If I only had some columns then I would call it "column identifiers". But if there are any function or subqueries this would be quite a bit more. Is "SELECT clause" a valid description?
- Same thing for the
FROMpart. If I have only one table I would simply call it "table". But if there is a more complicated structure maybe using joins, etc. what would be the correct naming?
To make my questions more clear:
In Postgres I could use a JSON function, e.g.
json_array_elements in both parts:SELECT
json_array_elements(my_json_column)
FROM
my_tableor doing this
SELECT
elem.*
FROM
my_table,
json_array_elements(my_json_column) AS elemIf I have to tell somebody that this function can be used within the
SELECT clause or as part of the FROM clause which terms are more conventional?Solution
It's usually called a "select list", which contains "select list items".
The
This is not specific to Postgres, by the way.
So, with respect to your use case you might say that
The
FROM clause contains a list of table references.This is not specific to Postgres, by the way.
So, with respect to your use case you might say that
json_array_elements() can be used both as an expression in the select list and as a table reference.Context
StackExchange Database Administrators Q#231476, answer score: 3
Revisions (0)
No revisions yet.