EXISTS

Determines if a collection is empty.

Syntax

[NOT] EXISTS (expression)

Arguments

expression: Any valid expression that returns a collection.
not: Specifies that the result of EXISTS be negated.

Return Value

true if the collection is not empty; otherwise, false.

Examples

select p from Products as p 
where exists(select p from Products as p where p.UnitPrice > 0)
select p from Products as p 
where not exists(select p from Products as p where p.UnitPrice > 0)

Last edited Mar 12, 2013 at 9:16 AM by ansiboy, version 1

Comments

No comments yet.