•Each select_expr  indicates a column that you want to retrieve. There must be at least one select_expr . 

• table_references  indicates the table or tables from which to retrieve rows. Its syntax is described in Section 13.2.10.2, “JOIN Clause” . 

• SELECT  supports explicit partition selection using the PARTITION  clause with a list of partitions or subpartitions (or both) following the name of the table in a table_reference  (see Section 13.2.10.2, “JOIN Clause” ). In this case, rows are selected only from the partitions listed, and any other partitions of the table are ignored. For more information and examples, see Section 24.5, “Partition Selection” . 

•The WHERE  clause, if given, indicates the condition or conditions that rows must satisfy to be selected. where_condition  is an expression that evaluates to true for each row to be selected. The statement selects all rows if there is no WHERE  clause. 

In the WHERE  expression, you can use any of the functions and operators that MySQL supports, except for aggregate (group) functions. See Section 9.5, “Expressions” , and Chapter 12, Functions and Operators . 

SELECT  can also be used to retrieve rows computed without reference to any table. 

For example: 

mysql> SELECT 1 + 1; -> 2 

 You are permitted to specify DUAL  as a dummy table name in situations where no tables are referenced: 

mysql> SELECT 1 + 1 FROM DUAL; -> 2 

DUAL  is purely for the convenience of people who require that all SELECT  statements should have FROM and possibly other clauses. MySQL may ignore the clauses. MySQL does not require FROM DUAL  if no tables are referenced. 

In general, clauses used must be given in exactly the order shown in the syntax description. For example, a HAVING  clause must come after any GROUP BY  clause and before any ORDER BY  clause. The INTO  clause, if present, can appear in any position indicated by the syntax description, but within a given statement can appear only once, not in multiple positions. For more information about INTO , see Section 13.2.10.1, “SELECT ... INTO Statement” . 

The list of select_expr  terms comprises the select list that indicates which columns to retrieve. Terms specify a column or expression or can use * -shorthand: 

•A select list consisting only of a single unqualified *  can be used as shorthand to select all columns from all tables: 

SELECT * FROM t1 INNER JOIN t2 ... 

• tbl_name .*  can be used as a qualified shorthand to select all columns from the named table: 

SELECT t1.*, t2.* FROM t1 INNER JOIN t2 ... 

•If a table has invisible columns, *  and tbl_name .*  do not include them. To be included, invisible columns must be referenced explicitly. 

•Use of an unqualified *  with other items in the select list may produce a parse error. To avoid this problem, use a qualified tbl_name .*  reference: 

SELECT AVG(score), t1.* FROM t1 ... 

