SELECT * FROM (SELECT
i.id_list,
i.id_category,
i.rating,
i.stars,
i.id_municipality,
i.id_fraction,
i.elevation,
lg.sigle AS path_sigle,
p.path,
il.id_item,
il.name,
il.preview,
z.id_zones
FROM
wct_list_point AS i,
wct_list_point_language AS il,
wct_language AS lg,
wct_path AS p,
wct_municipality AS m,
wct_zone AS z
WHERE
i.id_list='3'
AND il.id_item=i.tid
AND lg.tid='2'
AND p.id_language=lg.tid
AND il.id_language=p.id_language
AND il.visible='1'
AND p.id_item=il.id_item
AND p.id_list=i.id_list
AND i.visible='1'
AND i.id_municipality=m.tid AND TRUNCATE(6363 * sqrt(POW(RADIANS('46.70112408022434') - RADIANS(i.lat), 2) + POW(RADIANS('10.507132129955265') - RADIANS(i.lng), 2)), 3) < 10 AND (i.id_category like '24,%' OR i.id_category like '%,24' OR i.id_category like '%,24,%' OR i.id_category='24' OR i.id_category like '81,%' OR i.id_category like '%,81' OR i.id_category like '%,81,%' OR i.id_category='81' OR i.id_category like '79,%' OR i.id_category like '%,79' OR i.id_category like '%,79,%' OR i.id_category='79' OR i.id_category like '100,%' OR i.id_category like '%,100' OR i.id_category like '%,100,%' OR i.id_category='100' OR i.id_category like '80,%' OR i.id_category like '%,80' OR i.id_category like '%,80,%' OR i.id_category='80')
AND i.online='1'
AND m.id_zone=z.tid
ORDER BY
id_item ASC) AS selection
GROUP BY
id_item
ORDER BY
rating DESC, stars DESC, name ASC: Disk full (/tmp/#sql_4a8_1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")