Re: Applying WHERE on UNIONS

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Uri Dimant (urid_at_iscar.co.il)
Date: 11/23/04


Date: Tue, 23 Nov 2004 13:52:29 +0200

SELECT col.....
FROM
(
 SELECT col1... FROM TableA
 UNION ALL
SELECT col1... FROM TableB
) AS D
WHERE col.....

"Rafa®" <Rafa@discussions.microsoft.com> wrote in message
news:6236049E-9AA3-48F0-A0EC-AAC0227DEF71@microsoft.com...
> I have a simple question...
> How can I apply a WHERE clause to an entire UNION Query?
>
> Thx,
> Rafa®



Relevant Pages

  • Re: Advanced query issue
    ... FROM tablea As a RIGHT JOIN tableb as b ... That assumes tableb has all the possible occurrence of the two ... I also used UNION ALL, ...
    (microsoft.public.access.queries)
  • Re: Advanced query issue
    ... my mistake, in the second query, should have been UNION not UNION ALL, ... If lots of a.c are empty in the first query, it is because they appear ONLY ... FROM tablea As a RIGHT JOIN tableb as b ...
    (microsoft.public.access.queries)
  • Re: Advanced query issue
    ... and then write a query linking just by your new ... FROM tablea As a RIGHT JOIN tableb as b ... That assumes tableb has all the possible occurrence of the two ... I also used UNION ALL, ...
    (microsoft.public.access.queries)
  • Re: Full Outer Join
    ... > Usng the UNION ALL makes the query run a bit faster than just using UNION ... > TableB AS B ON A.FieldName = B.FieldName ... > FROM TableA AS C RIGHT JOIN ... >>A full outer join is done by unioning a left outer join with a right outer ...
    (microsoft.public.access.queries)
  • Re: Full Outer Join
    ... Usng the UNION ALL makes the query run a bit faster than just using UNION ... TableB AS B ON A.FieldName = B.FieldName ... FROM TableA AS C RIGHT JOIN ... >A full outer join is done by unioning a left outer join with a right outer ...
    (microsoft.public.access.queries)