next up previous
Next: Derived Relations Up: Nested Subqueries Previous: Test for Empty Relations

Test for the Absence of Duplicate Tuples

  1. The unique construct returns true if the argument subquery contains no duplicate tuples.
  2. Find all customers who have only one account at the SFU branch.

     aaaaa aa ¯select T.cname

    from depositor as T

    where unique (select R.cname

    from account, depositor as R

    where T.cname = R.cname and

    R.account# = account.account# and account.bname = ``SFU")

Osmar Zaiane
Fri May 22 19:39:12 PDT 1998