Cannot execute query: SELECT distinct trim(substring_index(place,',',-2)) as myplace, trim(place) as wholeplace, count(distinct place) as placecount, gedcom FROM tng_places WHERE trim(substring_index(place,',',-1)) = "Census lists her as a "Boarder" in Robert & Margaret Scroggins' home" AND gedcom = "1000" GROUP BY myplace ORDER by myplace