("MCSA/MCSE/MCDBA Self-Paced Training Kit: Microsoft SQL Server 2000
Database Design and Implementation Exam 70-229, Second Edition") I am
looking at the section on the ANY/ALL keyword.
<QUOTE>
USE Pubs
SELECT Title
FROM Titles
WHERE Advance > ANY
(
SELECT Advance
FROM Publishers INNER JOIN Titles
ON Titles.Pub_id = Publishers.Pub_id
AND Pub_name = 'Algodata Infosystems')
This statement finds the titles that received an advance larger than
the minimum advance amount paid by Algodata Infosystems (which, in this
case, is $5,000). The WHERE clause in the outer SELECT statement
contains a subquery that uses a join to retrieve advance amounts for
Algodata Infosystems. The minimum advance
amount is then used to determine which titles to retrieve from the
Titles table.
</QUOTE>
I don't understand why this references the "minimum advance". If you
run the subquery on its own, it returns the following values:
5000.0000
5000.0000
5000.0000
7000.0000
8000.0000
NULL
From my limited understanding, the "ANY" keyword applies to at least
one value, but which one? How is this determined?
Any help gratefully received.
Edward
--
The reading group's reading group:
http://www.bookgroup.org.uk