Subject RE: [firebird-support] Re: group by ??
Author Leyne, Sean
Dany,

> Maybe I do not explain myself very well. The records that I must
fetch,
> are those that I get by running the select clause that I post in first
> message, that is:
>
> select "PROC", max("FECH") from "MOVI" group by "PROC"
>
> ... but I have to get all the columns for those records.

Well you can't use "GROUP BY" for this purpose.

It seems that you are looking to do:

SELECT
M1."PROC",
(SELECT max(M2."FECH") FROM "MOVI" M2 WHERE M2."PROC" =
M1."PROC")
from "MOVI" M1

Needless to say that this is "sub-optimal" from a performance
perspective


Sean