SELECT restaurants.provincia, count(restaurants.id) AS count_provincia 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 ( domains.dominio='agriturismo-toscana.it' OR restaurants.categoria='agriturismo' ) GROUP BY restaurants.provincia ORDER BY count_provincia DESC ;
Content-type: text/html