On Thu, Sep 12, 2013 at 4:34 PM, Roberto Scattini <roberto.scattini@xxxxxxxxx> wrote:
hi, today we discovered that this query doesn't return the expected values:SELECT DISTINCTp.id, p.apellido AS "Apellido", p.nombre AS "Nombre", pf.nombre AS "Funcion", to_char(da.f_ingreso_pg, 'dd/mm/yyyy') AS "Fecha Ingreso PG", e.estado AS "Estado", to_char(pe.fecha, 'dd/mm/yyyy') AS "Fecha Estado"FROM personal.personas AS pLEFT JOIN personal.personas_da_pg AS da ON p.id=da.id_personaLEFT JOIN personal.personas_estado AS pe ON da.estado_id=pe.idLEFT JOIN personal.estados AS e ON pe.id_estado=e.idLEFT JOIN procu_departamento AS d ON d.id=da.id_departamentoLEFT JOIN procu_departamento AS dto ON left(d.c_organigrama, 4)||'000'=dto.c_organigramaLEFT JOIN procu_departamento AS dir ON left(d.c_organigrama, 3)||'0000'=dir.c_organigramaLEFT JOIN procu_departamento AS dg ON left(d.c_organigrama, 2)||'00000'=dg.c_organigramaLEFT JOIN personal.funciones AS pf ON pf.id=da.funcion_idLEFT JOIN personal.profesiones AS pp ON pp.id=p.id_profesionWHERE p.apellido ilike '%nuñez%'ORDER BY "Apellido"the exact same query with ilike '%NUÑEZ%' works OK...we are using postgresql 9.1 from ubuntu packages and the database encoding is (sadly) SQL_ASCIIcan anybody point me in the right direction to solve this issue?--
Roberto Scattini
If you could tells what you are expecting, and what you are actually getting, that would be helpful.
The person who says it cannot be done should not interrupt the person who is doing it. -- Chinese Proverb