Pervasive logo

Prev SQL Engine Reference Next

DISTINCT


Remarks

Include the DISTINCT keyword in your SELECT statement to direct Pervasive.SQL to remove duplicate values from the result. By using DISTINCT, you can retrieve all unique rows that match the SELECT statement's specifications.

The following rules apply to using the DISTINCT keyword:

You can use DISTINCT in any statement that includes subqueries.

The DISTINCT keyword is ignored if the selection list contains an aggregate; the aggregate guarantees that no duplicate rows result.

The following usage of DISTINCT is not allowed:

SELECT DISTINCT column1, DISTINCT column2 

Examples

The following statement retrieves all the unique courses taught by Professor Beir (who has a Faculty ID of 111191115):

SELECT DISTINCT c.Name 
FROM Course c, class cl 
WHERE c.name = cl.name AND cl.faculty_id = '111191115' 

See Also

SELECT


Prev
DELETE
Contents
Up
Check for Revisions
Next
DROP GROUP