DB function failed with 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 'AND REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( LOWER( jl.nom' at line 6 SQL=SELECT DISTINCT jl.nombre as nomLocalidad
FROM jca_inmobiliarias ji, jca_ccaas jc, jca_provincias jp, jca_localidades jl
WHERE ji.id_localidad = jl.id
AND jl.id_provincia = jp.id
AND jp.id_ccaa = jc.id
AND jp.id = AND REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( LOWER( jl.nombre ) , 'á', 'a' ) , 'é', 'e' ) , 'í', 'i' ) , 'ó', 'o' ) , 'ú', 'u' ) , 'ñ', 'n' ) , ' ', '-' ) <> 'pozuelo-de-alarcon' ORDER BY jl.nombre ASC