>>I have a SQL which contains a GROUP BY clause. For the record that will be extract for each group, I need to extract the oldest one. I have a primary field that could be used for that. Basically, the lowest value in the primary field determines the first record that was created in that group. I'm trying to find the best approach in the SQL to achieve that.
>
>Ok, don't worry. I forgot to add MIN(Numero) AS Numero in my SQL which takes care of that. I forgot that it was so simple.
It'll give you MIN(Numero) for each group but the rest of the fields in the record, that are not in group by clause, will come from the last physical record in the group which may or may not be the record with MIN(Numero).
--sb--