The SELECT statement in this example returns a list of the countries in which there are customers. Because there may be many customers in each country, many records could have the same country in the Customers table. However, each country is represented only once in the query results.
This example uses the Customers table, which contains the following data.
Country | Company name |
---|---|
Brazil | Familia Arquibaldo |
Brazil | Gourmet Lanchonetes |
Brazil | Hanari Carnes |
France | Du monde entier |
France | Folies gourmandes |
Germany | Frankenversand |
Ireland | Hungry Owl All-Night Grocers |
This SQL statement returns the countries in the following table:
SELECT DISTINCT Customers.Country
FROM Customers;
Countries returned |
---|
Brazil |
France |
Germany |
Ireland |