1
0
mirror of synced 2025-01-18 06:21:40 +03:00
This commit is contained in:
zYne 2007-08-11 18:12:30 +00:00
parent 2f85c85cf7
commit e5c02c2171

View File

@ -158,17 +158,17 @@ The NOT EXISTS operator returns TRUE if the subquery returns 0 rows and FALSE ot
Finding all articles which have readers:
<code>
FROM Article
WHERE EXISTS (FROM ReaderLog(id)
WHERE ReaderLog.article_id = Article.id)
FROM Article a
WHERE EXISTS (SELECT r.id FROM ReaderLog r
WHERE r.article_id = a.id)
</code>
Finding all articles which don't have readers:
<code>
FROM Article
WHERE NOT EXISTS (FROM ReaderLog(id)
WHERE ReaderLog.article_id = Article.id)
FROM Article a
WHERE NOT EXISTS (SELECT r.id FROM ReaderLog r
WHERE r.article_id = a.id)
</code>