Page 154 - SQL
P. 154
Conditions can also be joined to restrict the expression further:
select People where StartYear > 2005 and DepartmentID = 2
will result in the following table:
PROJECT
The project operator will return distinct field values from a table.
project < table > over < field list >
For example, examine the following expression:
project People over StartYear
This can be written as:
This will result in a table comprising of the distinct values held within the StartYear field of the
People table.
Duplicate values are removed from the resulting table due to the closure property creating a
relational table: all records in a relational table are required to be distinct.
If the field list comprises more than a single field then the resulting table is a distinct version of
these fields.
project People over StartYear, DepartmentID will return:
One record is removed due to the duplication of 2006 StartYear and 1 DepartmentID.
https://riptutorial.com/ 136

