January 2019
Beginner
556 pages
14h 19m
English
Also related to the SELECT-list is a pair of keywords, DISTINCT and ALL, that can be used right after the SELECT keyword. When DISTINCT is specified, only unique rows from the input dataset will be returned. ALL returns all the rows—this is the default.
Consider the following example:
car_portal=> SELECT ALL make FROM car_portal_app.car_model; make--------------- Audi Audi Audi Audi BMW BMW...(99 rows)
Consider the second example:
car_portal=> SELECT DISTINCT make FROM car_portal_app.car_model; make--------------- Ferrari GMC Citroen UAZ Audi Volvo...(25 rows)
The input in both cases is the same: the table with the car models. However, the first query returned 99 records while the second only returned 25. This is because the first ...
Read now
Unlock full access