How to make a UNION query without same field order (1 Viewer)

elly.khanlar

Registered User.
Local time
Yesterday, 23:20
Joined
Oct 3, 2019
Messages
23
Hi everyone,
I'm trying to make a union query of two tables but some of the fields are not in same sequent. Is there a way to create a union query with these two tables?
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 20:20
Joined
Oct 29, 2018
Messages
21,455
I guess you'll have to specify the fields then. In other words, if you can't do this:
Code:
select * from table1
union
select * from table2
Then you might have to do this:
Code:
select field1, field2, field3 from table1
union
select field4, field5, field6 from table2
 

Users who are viewing this thread

Top Bottom