PreviousSQL Engine Reference (9.1 revision 1) Next

ALL

Show this topic in Library frames

Remarks

When you specify the ALL keyword before a subquery, Pervasive.SQL 9 SP1 (9.1) performs the subquery and uses the result to evaluate the condition in the outer query. If all the rows the subquery returns meet the outer query's condition for a particular row, Pervasive.SQL 9 SP1 (9.1) includes that row in the final result table of the statement.

Generally, you can use the EXISTS or NOT EXISTS keyword instead of the ALL keyword.

Examples

The following SELECT statement compares the ID column from the Person table to the ID columns in the result table of the subquery:

SELECT p.ID, p.Last_Name 
FROM Person p 
WHERE p.ID <> ALL 
(SELECT f.ID FROM Faculty f WHERE f.Dept_Name = 
'Chemistry')  

If the ID value from Person does not equal to any of the ID values in the subquery result table, Pervasive.SQL includes the row from Person in the final result table of the statement.

See Also

SELECT (with into)

SELECT

UNION


Chapter contents
Publication contents

Prev topic: ADD
Next topic: ALTER (rename)