Union with inner join, mysql error -
(select * app_detailsvvv dtable inner join new_apps on new_apps.trackid=dtable.trackid primarygenrename='games' , composed='1' , new_apps.top>0) union (select * app_detailsvvv dtable primarygenrename='games') limit 12
error:
#1222 - used select statements have different number of columns
on new_apps there fields not in app_detailsvvv, how can mask second query in union somehow.
edit:
(select dtable.* app_detailsvvv dtable inner join new_apps on new_apps.trackid=dtable.trackid primarygenrename='games' , composed='1' , new_apps.top>0) union (select * app_detailsvvv dtable primarygenrename='games') limit 12
worked yet when add order new_apps.top asc
new error:
#1250 - table 'new_apps' 1 of selects cannot used in global order clause
try this:
(select dtable.* app_detailsvvv dtable inner join new_apps on new_apps.trackid=dtable.trackid primarygenrename='games' , composed='1' , new_apps.top>0) union (select * app_detailsvvv dtable primarygenrename='games') limit 12
Comments
Post a Comment