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.66869664523509') - RADIANS(i.lat), 2) + POW(RADIANS('11.176080522823323') - RADIANS(i.lng), 2)), 3) < 5 AND (i.id_category like '1,%' OR i.id_category like '%,1' OR i.id_category like '%,1,%' OR i.id_category='1' OR i.id_category like '84,%' OR i.id_category like '%,84' OR i.id_category like '%,84,%' OR i.id_category='84' OR i.id_category like '85,%' OR i.id_category like '%,85' OR i.id_category like '%,85,%' OR i.id_category='85' OR i.id_category like '87,%' OR i.id_category like '%,87' OR i.id_category like '%,87,%' OR i.id_category='87' OR i.id_category like '89,%' OR i.id_category like '%,89' OR i.id_category like '%,89,%' OR i.id_category='89' OR i.id_category like '88,%' OR i.id_category like '%,88' OR i.id_category like '%,88,%' OR i.id_category='88' OR i.id_category like '73,%' OR i.id_category like '%,73' OR i.id_category like '%,73,%' OR i.id_category='73')
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")