SELECT
On this page
The SELECT
statement is used to retrieve data from a table.
The SELECT
clause specifies the columns to be retrieved from the table(s).SELECT
page gives details of the syntax for these options.
The following clauses make up the basic parts of a SELECT
statement.FROM
clause in most cases.
The FROM Clause
The FROM
clause specifies which table(s) data will be queried from.JOIN
clause.
The WHERE Clause
The WHERE
clause specifies the conditions that must be met for a row to be included in the result set.
The GROUP BY and HAVING Clauses
The GROUP BY
clause groups rows together that have the same values for columns listed in the SELECT
clause.GROUP BY
clause in queries that contain aggregate functions.
The HAVING
clause is used to filter the results of queries that use a GROUP BY
clause.HAVING
clause can refer to grouped and ungrouped columns.
The ORDER BY Clause
The ORDER BY
clause sorts the result set of a query based on one or more columns.ASC
) or descending (DESC
) can be specified.ASC
or DESC
, the sort will be in ascending order.
The LIMIT Clause
The LIMIT
clause is used to restrict the number of rows returned in the result set to the number specified.
Related Information
SQL Functions List - this is a list of all the SQL functions SingleStore current used.SELECT
statements.
Last modified: June 22, 2023