(select packages.* , countries_name as CountryName from packages join packages_countries on Id=IdPackage join countries on countries_iso_code_2=packages_countries.IdCountry join regions_countries on regions_countries.IdCountry = packages_countries.IdCountry where packages.Id!=62 and packages.Active=0 and IdRegion = group by packages.Id order by rand() limit 0,3) union DISTINCT ( select packages.* , countries_name as CountryName from packages join packages_countries on Id=IdPackage join countries on countries_iso_code_2=packages_countries.IdCountry join regions_countries on regions_countries.IdCountry = packages_countries.IdCountry where packages.Id!=62 and packages.Active=0 group by packages.Id order by rand() limit 0,3 )
Mysql Error Number 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'group by packages.Id order by rand() limit 0,3) union DISTINCT ( select package' at line 1