Subject RE: [firebird-support] Re: help with a select
Author Svein Erling Tysvær
>Thanks Set!! As usual, your suggestion works perfect !!
>May I know what was wrong with my approach?

Well, I can see two things that may not be what you intended by looking at the fields you select:

this is OK

this could be what you perceive to be not all rows, at least there will only be one row for the combination of the fields you do not group by (c.fecha, p.dni, p.apellido || ' ' || p.nombre)

this will return the lowest value for rubrica_completa, which may be linked to any, not necessarily the lowest one. If I have a table PERSON containing FIRSTNAME and LASTNAME and the two rows Helen Borrie and Dmitry Yemanov and did SELECT MIN(FIRSTNAME), MIN(LASTNAME) FROM PERSON, I would end up with Dmitry Borrie.

p.apellido || ' ' || p.nombre
these are ok