A Database Error Occurred

Error Number: 1064

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'GROUP BY pro.id' at line 1

SELECT ( CASE when pro.unit_type = 1 then 'Sq.Ft' when pro.unit_type=2 then 'Sq. Yd.' when pro.unit_type = 3 then 'Sq. Mt' END) as unit, pro.country_id,pro.new_amenities,pro.location_map, pro.payment_plan, pro.highlights,ptype.type as propertyType,pctype.type_category as propertyTypeCategory,city.id as cityId, city.city as cityName, city.crm_city_id as crmCityId, dev.id as developerId, dev.name as developer,dev.description,dev.logo as developerLogo, pro.possession_date,pro.new_overview,(case when ms.property_name_to_display !='' then ms.property_name_to_display else pro.property_name end ) as property_name, pro.property_name as propertyrealname, pro.id as propertyId,pro.booking_status,pro.bedrooms,loc.location,MIN(CAST( prices.size AS SIGNED )) AS minSize,MAX(CAST( prices.size AS SIGNED )) AS maxSize, CAST(prices.TYPE AS SIGNED ) AS setType, MIN(CAST( REPLACE( prices.amount, ',', '' ) AS SIGNED ) ) AS minAmount, MAX( CAST( REPLACE( prices.amount, ',', '' ) AS SIGNED ) ) AS maxAmount, MIN( prices.amount ) AS minStaticAmount, MAX( prices.amount ) AS maxStaticAmount,ms.micromarket_id FROM tsr_properties as pro INNER JOIN tsr_types as ptype ON pro.type_id=ptype.id INNER JOIN tsr_types_categories as pctype ON pro.cat_id=pctype.id INNER JOIN tsr_locations loc ON pro.loc_id=loc.id INNER JOIN tsr_cities as city ON pro.cty_id=city.id INNER JOIN tsr_microsites as ms on ms.propty_id = pro.id INNER JOIN tsr_developers dev ON pro.devlpr_id=dev.id and dev.status=1 and loc.status=1 and loc.status=1 LEFT OUTER JOIN tsr_prices prices ON pro.id=prices.propty_id and prices.amount!='On Request' WHERE pro.id= GROUP BY pro.id

Filename: /var/www/html/my_app_ms/models/microsites/model_microsite.php

Line Number: 99