SELECT upper(restaurants.comune) AS localita, count(restaurants.id) AS count_localita FROM restaurants LEFT JOIN associations ON associations.restaurant_id = restaurants.id LEFT JOIN domains ON domains.id = associations.domain_id WHERE restaurants.enable='Y' AND upper(restaurants.regione)=E'TOSCANA' AND restaurants.provincia='LUCCA' AND (domains.dominio='agenziefunebrilucca.it' OR restaurants.categoria='imprese-funebri' ) GROUP BY upper(restaurants.comune) ORDER BY count_localita DESC ;
Content-type: text/html