SELECT CodeType From
(
SELECT tblCodes.CodeType FROM tblCodes
UNION
SELECT "CeremonyStatus" as CodeType FROM tblCodes
) AS TMP
WHERE (((TMP.CodeType)="CeremonyStatus"));
This will
produce all the rows from the table (count=x),
then all the rows again (every row has the codetype hard-set to "CeremonyStatus"), (count=x)
then UNION them together followed by DISTINCT (count=2x, distinct down to count=x)
This becomes the subquery TMP.
The WHERE clause is applied to TMP, which results in one single result, "CeremonyStatus"
In short, yes you can WHERE a UNION, just subquery it.