union query with "unique" and "is not null" values

M

Mark Kubicki

how do I add to the properties of a Union Query a limit for all the vaules
to be UNIQUE and "IS NOT NULL";

easy to do with the simple query, but I am totally lost in my Union Query
attempts.

as always, thanks in advance,
mark

SELECT [QuoteSource]
FROM [FixtureTypesNoProject]

UNION SELECT [QuoteSource]
FROM [FixtureCatalogueCostHistory]
ORDER BY [QuoteSource];
 
M

Marshall Barton

Mark said:
how do I add to the properties of a Union Query a limit for all the vaules
to be UNIQUE and "IS NOT NULL";

easy to do with the simple query, but I am totally lost in my Union Query
attempts.

as always, thanks in advance,
mark

SELECT [QuoteSource]
FROM [FixtureTypesNoProject]

UNION SELECT [QuoteSource]
FROM [FixtureCatalogueCostHistory]
ORDER BY [QuoteSource];


Add a WHERE clause ro each select query to deal with the
Null issue

SELECT [QuoteSource]
FROM [FixtureTypesNoProject]
WHERE QuoteSource Is Not Null

UNION

SELECT [QuoteSource]
FROM [FixtureCatalogueCostHistory]
WHERE QuoteSource Is Not Null

ORDER BY [QuoteSource];

Using UNION instead if UNION ALL is sufficient to limit the
results to distinct records.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top