Access SQL

Excel VBA
Excel Formulas
User-defined Functions
Office Links
Access VBA
Access SQL
Alan’s Excel FAQ
Excel Home
Alan’s Home

Sub Query

A sub-query is an additional SELECT within another. In this case, we were looking for duplicate names within a large table.
SELECT DISTINCT FIPS55.State, FIPS55.CountyID, FIPS55.CountyName AS County INTO Counties
FROM FIPS55
WHERE (((FIPS55.CountyName) In (SELECT [CountyName] FROM [FIPS55] As Tmp GROUP BY [CountyName] HAVING Count(*)>0 )))
ORDER BY FIPS55.CountyName, FIPS55.State;

Access can build these automatically for you in the Analysis section or you can key them yourself.

Sub Query image

© 2008-2011

Updated:  09/11/2011 15:58
This page added:  26 October 2008