Subject | RE: [firebird-support] Re: group by ?? |
---|---|
Author | Leyne, Sean |
Post date | 2008-06-09T19:13:02Z |
Dany,
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
> Maybe I do not explain myself very well. The records that I mustfetch,
> are those that I get by running the select clause that I post in firstWell you can't use "GROUP BY" for this purpose.
> message, that is:
>
> select "PROC", max("FECH") from "MOVI" group by "PROC"
>
> ... but I have to get all the columns for those records.
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