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.53265873238819') - RADIANS(i.lat), 2) + POW(RADIANS('11.43909208833008') - RADIANS(i.lng), 2)), 3) < 5 AND (i.id_category like '121,%' OR i.id_category like '%,121' OR i.id_category like '%,121,%' OR i.id_category='121' OR i.id_category like '7,%' OR i.id_category like '%,7' OR i.id_category like '%,7,%' OR i.id_category='7' OR i.id_category like '98,%' OR i.id_category like '%,98' OR i.id_category like '%,98,%' OR i.id_category='98' OR i.id_category like '99,%' OR i.id_category like '%,99' OR i.id_category like '%,99,%' OR i.id_category='99' OR i.id_category like '71,%' OR i.id_category like '%,71' OR i.id_category like '%,71,%' OR i.id_category='71' OR i.id_category like '70,%' OR i.id_category like '%,70' OR i.id_category like '%,70,%' OR i.id_category='70' OR i.id_category like '103,%' OR i.id_category like '%,103' OR i.id_category like '%,103,%' OR i.id_category='103' OR i.id_category like '57,%' OR i.id_category like '%,57' OR i.id_category like '%,57,%' OR i.id_category='57' OR i.id_category like '5,%' OR i.id_category like '%,5' OR i.id_category like '%,5,%' OR i.id_category='5' OR i.id_category like '61,%' OR i.id_category like '%,61' OR i.id_category like '%,61,%' OR i.id_category='61' OR i.id_category like '63,%' OR i.id_category like '%,63' OR i.id_category like '%,63,%' OR i.id_category='63' OR i.id_category like '83,%' OR i.id_category like '%,83' OR i.id_category like '%,83,%' OR i.id_category='83' OR i.id_category like '69,%' OR i.id_category like '%,69' OR i.id_category like '%,69,%' OR i.id_category='69')
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")