The SELECT
statement is used to select data from a
database.
SELECT column1, column2, ...
FROM table_name;
Here, column1, column2, ... are the field names of the table you want to select data from.
The table_name represents the name of the table you want to select data from.
use ***** in fields
SELECT * FROM Customers;
The SELECT DISTINCT
statement is used to return only distinct (different) values.
Inside a table, a column often contains many duplicate values; and sometimes you only want to list the different (distinct) values.
SELECT DISTINCT Country FROM Customers;
// Canada, America, China, ...
SELECT COUNT(DISTINCT Country) FROM Customers;
// 21