SELECT cupon.idcupon,CONCAT('cupones/',cupon.imagen) AS imagen FROM cupon INNER JOIN clientesede ON cupon.idcliente=clientesede.idcliente WHERE idestadocupon IN (2,5) AND idconsumidor LIKE { ncnd} AND { lat} BETWEEN latitud-0.0008 AND latitud+0.0008 AND { long} BETWEEN longitud-0.0008 AND longitud+0.0008 AND idcategorias LIKE { cdcts}