SQL
SELECT Statement
Retrieve data from a database.
By TechCoder TeamLast updated: 2026-06-02
In a Nutshell
Retrieve data from a database. This hands-on tutorial focuses on practical implementation of select statement concepts.
SELECT Statement
The SELECT statement is used to select data from a database. The data returned is stored in a result table, called the result-set.
Selecting All Columns
To select all columns from a specific table, use the asterisk * symbol.
SELECT * FROM table_name;
Example:
SELECT * FROM Customers;
Selecting Specific Columns
To select only specific columns, list their names separated by commas.
SELECT column1, column2 FROM table_name;
Example:
SELECT CustomerName, City FROM Customers;
SELECT DISTINCT
The SELECT DISTINCT statement is used to return only distinct (different) values. In a table, a column may contain many duplicate values; and sometimes you only want to see the distinct values.
SELECT DISTINCT Country FROM Customers;