Select (SQL): Difference between revisions

Content deleted Content added
Overview: mention that DISTINCT is a type of GROUP BY
Add SELECT clause, better wording for AS (it doesn't "temporarily rename" columns), move AS after SELECT clause
Line 5:
The SELECT statement has many optional clauses:
 
* <code>SELECT</code> clause is the list of columns or SQL expressions that must be returned by the query.
* <code>[[Alias (SQL)|AS]]</code> optionally provides an alias whichfor caneach becolumn usedor toexpression temporarilyin renamethe tables or<code>SELECT</code> columnsclause.
* <code>[[From (SQL)|FROM]]</code> specifies from which table to get the data.<ref>Omitting FROM clause isn't standard, but allowed by most major DBMSes.</ref>
* <code>[[Where (SQL)|WHERE]]</code> specifies which rows to retrieve.
Line 10 ⟶ 12:
* <code>[[Having (SQL)|HAVING]]</code> selects among the groups defined by the GROUP BY clause.
* <code>[[Order by (SQL)|ORDER BY]]</code> specifies how to order the returned rows.
* <code>[[Alias (SQL)|AS]]</code> provides an alias which can be used to temporarily rename tables or columns.
 
== Overview ==