Subject | Re: [firebird-support] How to get the latest record? |
---|---|
Author | Mark Rotteveel |
Post date | 2011-12-18T09:44:36Z |
On 18-12-2011 6:11, ehaerim wrote:
for the date, then it becomes trivial to query the latest.
Mark
--
Mark Rotteveel
>First of all: don't encode information like this: use a separate field
> A table was created like
>
> create table Test(ITEM varchar(20) not null primary key, VAL
> varchar(20));
>
> It is filled by records like
>
> (aaa_20111215, ...)
> (aaa_20111215, ...)
> (aaa_20111201, ...)
> ...
>
> My question is how to select the record having the latest date for ITEM?
>
> The answer for the above records is (aaa_20111215, ...).
>
> Please write a sql to do this.
for the date, then it becomes trivial to query the latest.
Mark
--
Mark Rotteveel