DATABASE ERROR:

SELECT * FROM ((SELECT c.*, 'cms' AS hi  FROM cms_clubs c WHERE c.published = 1
                         
 LIMIT 1000) UNION ALL (SELECT c.*, 'ddt3' AS hi FROM ddt3_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'd1' AS hi FROM d1_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'ddteachkhoy' AS hi FROM ddteachkhoy_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'addt' AS hi FROM addt_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'cdtta' AS hi FROM cdtta_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'ekoachkhoy' AS hi FROM ekoachkhoy_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'vrc' AS hi FROM vrc_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'ddt2' AS hi FROM ddt2_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'cdttved' AS hi FROM cdttved_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'ekovedeno' AS hi FROM ekovedeno_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'ddt13' AS hi FROM ddt13_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'ctkargun' AS hi FROM ctkargun_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'ekoargun' AS hi FROM ekoargun_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'cdttargun' AS hi FROM cdttargun_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'zav' AS hi FROM zav_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'len' AS hi FROM len_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'oct' AS hi FROM oct_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'star' AS hi FROM star_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'sdt' AS hi FROM sdt_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'grozduc' AS hi FROM grozduc_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'ddtegroz' AS hi FROM ddtegroz_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'ddt7' AS hi FROM ddt7_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'cdttgroz' AS hi FROM cdttgroz_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'ekogroz' AS hi FROM ekogroz_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'kduc' AS hi FROM kduc_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'kcdt' AS hi FROM kcdt_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'cdttk' AS hi FROM cdttk_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'ddt6' AS hi FROM ddt6_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'ekokurchaloy' AS hi FROM ekokurchaloy_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'ddtenad' AS hi FROM ddtenad_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'ddt10' AS hi FROM ddt10_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'cdttnad' AS hi FROM cdttnad_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'ekonad' AS hi FROM ekonad_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'ddt8' AS hi FROM ddt8_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'ncdtk' AS hi FROM ncdtk_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'cdttnaur' AS hi FROM cdttnaur_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'nurc' AS hi FROM nurc_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'cdttn' AS hi FROM cdttn_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'ekonojay' AS hi FROM ekonojay_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'ddtesun' AS hi FROM ddtesun_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'ddt5' AS hi FROM ddt5_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'cdtts' AS hi FROM cdtts_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'ekosunzha' AS hi FROM ekosunzha_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'ddt9' AS hi FROM ddt9_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'rcdturus' AS hi FROM rcdturus_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'cdtturus' AS hi FROM cdtturus_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'ekourus' AS hi FROM ekourus_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'ddteshali' AS hi FROM ddteshali_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'ddt4' AS hi FROM ddt4_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'ecoshali' AS hi FROM ecoshali_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'ddt12' AS hi FROM ddt12_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'ddt1' AS hi FROM ddt1_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'shelkdut' AS hi FROM shelkdut_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'sctt' AS hi FROM sctt_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'e11' AS hi FROM e11_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'cte' AS hi FROM cte_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'rctt' AS hi FROM rctt_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'rct' AS hi FROM rct_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'rbc' AS hi FROM rbc_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'muk' AS hi FROM muk_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'gdc' AS hi FROM gdc_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'ddtegudermes' AS hi FROM ddtegudermes_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'cdttgud' AS hi FROM cdttgud_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'ddt11' AS hi FROM ddt11_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'mdc' AS hi FROM mdc_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC UNION ALL (SELECT c.*, 'ekogudermes' AS hi FROM ekogudermes_clubs c WHERE c.published = 1
                         
 LIMIT 1000)  ) t GROUP BY t.title ORDER BY t.pubdate DESC LIMIT 1000

Incorrect usage of UNION and ORDER BY