Hi
How can I merge the result of few quries that had been unioned ?
example:[code=mysql]
SELECT item1,item2,ite m3 FROM table111 WHERE item2='somethin g' GROUP BY item1
UNION
SELECT item1,item2,ite m3 FROM table222 WHERE item2='somethin g' GROUP BY item1
UNION
SELECT item1,item2,ite m3 FROM table333 WHERE item2='somethin g' GROUP BY item1[/code]
NOTE:
table111, table222, and table333 has the same structure
always i'm asking for same items to be selected here and for same group by and where statment
the difference is with the table names
each table has different records than the other table
Is there any available code to do this ! any solution !
do you any idea of how doing this, do you have any simple example ?
How can I merge the result of few quries that had been unioned ?
example:[code=mysql]
SELECT item1,item2,ite m3 FROM table111 WHERE item2='somethin g' GROUP BY item1
UNION
SELECT item1,item2,ite m3 FROM table222 WHERE item2='somethin g' GROUP BY item1
UNION
SELECT item1,item2,ite m3 FROM table333 WHERE item2='somethin g' GROUP BY item1[/code]
NOTE:
table111, table222, and table333 has the same structure
always i'm asking for same items to be selected here and for same group by and where statment
the difference is with the table names
each table has different records than the other table
Is there any available code to do this ! any solution !
do you any idea of how doing this, do you have any simple example ?
Comment