Can query pick from four diffrent field and past it only in one filed

  • Thread starter Thread starter Mike Saifie
  • Start date Start date
M

Mike Saifie

Can I build a query where it can pick from four diffrent field and place it
on one single field.
Mike

filed1 field 2 field 3

resust is like this

field1
field2
field3
 
Yes, you can use a "union" query to do this. The SQL for that query would
look something like this:

SELECT field1 AS theField FROM theTable

UNION ALL SELECT field2 AS theField FROM theTable
UNION ALL SELECT field3 AS theField FROM theTable

This result from this query will be a list of records with the first batch
of records containing field1 and the next batch of records containing field2
and so on. The UNION query is a good way to deal with un-normalized tables
that have several fields containing the same type of data.

Lee Robinson
 
Back
Top