Subject Re: [ib-support] Searching for last record
Author Helen Borrie
At 04:13 PM 18-06-02 +0300, you wrote:
>Andrew Guts wrote:
>
> >update catalogue
> > set last_location =
> > (select location from transfers x where x.catalog_id = catalogue.id
> >and x.id =
> > (select max(id) from transfers cx where cx.catalog_id = x.catalog_id))
> >
> >
> >
>By the way it's a surprise:
>
>"Error: multiple rows in singleton select"
>
>So "max()" could return multiple rows?. How nice.

No, it can't; but your first sub-select can return multiple rows and it's
not permitted in a sub-select.

heLen

All for Open and Open for All
Firebird Open SQL Database · http://firebirdsql.org ·
http://users.tpg.com.au/helebor/
_______________________________________________________