Site Menu
- Home
- Products
- NexusDB
- Nexus Quality Suite
- NexusDB Drivers & Connectors
- Nexus Remoting
- Nexus Memory Manager
- Some of our Customers
- Testimonials and use(r)s
- Downloads
- Documentation
- Support
- Pricing & Orders
- About
- Community
- My Nexus
- Recently Updated ...
- Search...
- Site Login
Search
Exists Predicate


Specify a test for a non-empty set.
Syntax
<exists predicate> ::= EXISTS <table subquery>
Notes
♦ | The predicate evaluates to TRUE if the cardinality of the subquery result is greater than 0, else to FALSE. |
Examples
1) | The following example selects students enrolled in more than 2 courses: |
SELECT studentID, studentName
FROM students s
WHERE EXISTS (
SELECT COUNT( * )
FROM enrolls
WHERE studentID = s.studentID
HAVING COUNT( * ) > 2
)
2) | The following example selects students not enrolled in any courses: |
SELECT studentID, studentName
FROM students s
WHERE EXISTS (
SELECT COUNT( * )
FROM enrolls
WHERE studentID = s.studentID
HAVING COUNT( * ) = 0
)
Conformance
SQL:2003 standard |
- - |
Core SQL Feature T501 "Enhanced EXISTS predicate" |
Questions? Problems?
- Interested to buy but something put you off?
- Can't find what you're looking for?
- Have a suggestion?
Let us know. If you're having trouble contacting us, please check here.
Site Updates
- May 14 2025 - 12:32pm
- Mar 19 2025 - 9:52pm
- Mar 19 2025 - 11:17am
- Mar 14 2025 - 11:23am
- Mar 13 2025 - 11:42pm