1
0
mirror of synced 2025-01-29 19:41:45 +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: Finding all articles which have readers:
<code> <code>
FROM Article FROM Article a
WHERE EXISTS (FROM ReaderLog(id) WHERE EXISTS (SELECT r.id FROM ReaderLog r
WHERE ReaderLog.article_id = Article.id) WHERE r.article_id = a.id)
</code> </code>
Finding all articles which don't have readers: Finding all articles which don't have readers:
<code> <code>
FROM Article FROM Article a
WHERE NOT EXISTS (FROM ReaderLog(id) WHERE NOT EXISTS (SELECT r.id FROM ReaderLog r
WHERE ReaderLog.article_id = Article.id) WHERE r.article_id = a.id)
</code> </code>