select count(*) as total,concat(?__stations.station_name_en,?__stations.category) as sc from ?__stations, ?__categories, ?__locations as continent, ?__locations as country, ?__locations as city where ?__stations.category like concat('%|',?__categories.id,'|%') and continent.id=?__stations.continent and country.id=?__stations.country and city.id=?__stations.city and (continent.title_en like '%greece%' or country.title_en like '%greece%' or city.title_en like '%greece%' or ?__stations.station_name_en like '%greece%' or ?__categories.title_en like '%greece%') group by sc