Creating a query out of another query


M

Maracay

Hi Guys,

I have a query looking like that:

field1 field2 field3 field4 field5 field6
Data 1 Test 6
Poly 8
Data 5 Poly 10

I need a query from this query like this:

Field 1 Field 2
Data 1
Test 6
Poly 8
Data 5
Poly 10

I'll really appreciate if someone can help me with this one

Thanks
 
Ad

Advertisements

K

KARL DEWEY

This should do it --
SELECT Field1 AS Field_1, Field2 AS Field_2
FROM YourTable
WHERE Field1 Is Not Null
UNION ALL SELECT Field3 AS Field_1, Field4 AS Field_2
FROM YourTable
WHERE Field3 Is Not Null
UNION ALL SELECT Field3 AS Field_1, Field6 AS Field_2
FROM YourTable
WHERE Field5 Is Not Null;
 

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

Top