multi column to 1 query

  • Thread starter Thread starter Anton
  • Start date Start date
A

Anton

I am trying to create a query that selects data from 15
or 20 columns.
The unique results should be presented in a single
column, so it can be used as a pick list.
Is this possible?
And if so, how dshould I do it?

Thanx in advance.
Anton
 
Sounds like your data structure may not be normalized. Similar data in 15
or 20 fields sounds more like a one-to-many relationship. What is your
table structure? What are the fields?

Rick B


I am trying to create a query that selects data from 15
or 20 columns.
The unique results should be presented in a single
column, so it can be used as a pick list.
Is this possible?
And if so, how dshould I do it?

Thanx in advance.
Anton
 
Take a look at a union query. This should give you the results you are looking
for if it can handle that many unions in one query. Otherwise, you may need to
create a table and populate it with a series of Append queries and then run a
query against that.

SELECT ColumnA
FROM TABLE
UNION
SELECT ColumnB
FROM TABLE
UNION
SELECT ...

A UNION (as opposed to UNION ALL) query will strip out duplicate rows, so you
don't need to use a Distinct clause to get rid of duplicate values.
 
Thank you John it did the trick.
Anton
-----Original Message-----
Take a look at a union query. This should give you the results you are looking
for if it can handle that many unions in one query. Otherwise, you may need to
create a table and populate it with a series of Append queries and then run a
query against that.

SELECT ColumnA
FROM TABLE
UNION
SELECT ColumnB
FROM TABLE
UNION
SELECT ...

A UNION (as opposed to UNION ALL) query will strip out duplicate rows, so you
don't need to use a Distinct clause to get rid of duplicate values.

.
 
Back
Top