Subject Re: [firebird-support] Re: group by ??
Author Fabian Chocron
Dani,

The 2 SQL codes I sent you also do that, however your table seems to need a
PK, without it SQL will not work properly, as there is no way to identify a
record without a PK.

Fabian

----- Original Message -----
From: "danyschaer" <danyschaer@...>
To: <firebird-support@yahoogroups.com>
Sent: Tuesday, June 10, 2008 7:57 AM
Subject: [firebird-support] Re: group by ??


Thanks to all for each try, but it seams I am not clear with my
example; so please give me a chance to try again:

An sample table called MOVI is:

MOVI Char(10) ----------> primary key (unique record id)
PROC Char(10) ----------> groups key
FECH Char(12) ----------> datetime
DSCR Varchar(200) ------> description
etc, etc, etc ..

I have to get the whole record with the last FECH, of each group. I
can obtain the last FECH very fast, by doing:

select max("FECH") from "MOVI" group by "PROC"

But ... how to get whe whole record instead of only "FECH" ???

Thanx again.

Dany