I'm trying to merge two SELECT request and group it into the same attributes.
I have two tables which contain lot of attributes and some are in common (or have the same meaning in "human language").
I already tried the CROSS JOIN and the SELECT * FROM table1 (SELECT * FROM TABLE2)) but it won't work.
For example:
Table1:
{[Attribute1 = "Name1",
Attribute2 = age1,
Attribute3 = "Bla",
Attribute4 = "Blabla",
Attribute5 = 153,
Attribute6 = "something"] ,
[Attribute1=....,....], ...}
Table2:
{[Attribute1="Name25",
NotInterestingAttribute1="blabla",
Attribute15=125,
Attribute18="somethingElse"],
[Attribute1=....], ...}
My aim is to obtain something like
FinalTable:
{[Attribute1="Name1", Attribute2=125, Attribute3="something"] ,
[Attribute1="Name25", Attribute2=153, Attribute3="somethingElse"]}
I'm really sorry, I tried to make some real table but I failed.
I don't know if I'm clear enough, please let me know if I'm not.
Thanks for the help !
EDIT:
This is the SELECT request I'm trying to use at the moment:
SELECT Attribute1 as Attribute1,
Attribute5 as Attribute2,
Attribute15 as Attribute2,
Attribute6 as Attribute3,
Attribute18 as Attribute3
FROM Table1, Table2
WHERE Attribute1 like '%name%';
You are looking for
UNION ALLBut if the field are name different on each table you use alias so they are align on the same field