SELECT

Syntax:

SELECT [STRAIGHT_JOIN] [SQL_SMALL_RESULT] [SQL_BIG_RESULT] [SQL_BUFFER_RESULT]
  [HIGH_PRIORITY]
  [DISTINCT]
select_expression,...
[INTO {OUTFILE | DUMPFILE} '/path/to/filename' export_options]
[FROM table_references
  [WHERE where_definition]
  [GROUP BY {column_name | column_alias | column_position | formula}
    [ASC | DESC], ...]
  [HAVING where_definition]
  [ORDER BY {column_name | column_alias | column_position | formula}
    [ASC | DESC], ...]
  [LIMIT [offset,] num_rows]
  [PROCEDURE procedure_name]

Description: Runs a query on one or more tables and returns a resultset table populated with the rows of data retrieved.

select_expression specifies the columns to be retrieved, and table_references is a list of table names (comma-separated if ...

Get Sams Teach Yourself MySQL in 21 Days, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.