Subqueries that are introduced with unmodified comparison operators often include the distinct keyword to ensure the return of a single value.
For example, without distinct, this subquery fails because it returns more than one value:
select pub_name from publishers where pub_id = (select distinct pub_id from titles where pub_id = publishers.pub_id)
Copyright © 2005. Sybase Inc. All rights reserved. |