- $sSQL = 'select address_place_id';
- $sSQL .= ' FROM place_addressline';
- $sSQL .= " WHERE place_id = $iPlaceID";
+ $sSQL = 'select a.address_place_id';
+ $sSQL .= ' FROM place_addressline a, placex p';
+ $sSQL .= " WHERE a.place_id = $iPlaceID and a.address_place_id = p.place_id";
+ $sSQL .= ' AND p.linked_place_id is null';