Обсуждение: select max(oid)

Поиск
Список
Период
Сортировка

select max(oid)

От
soundar rajan
Дата:
Hi all,

How do I

select max(oid) from table;

I'm able to to
select max(fieldname) from tablename;
but not max(oid).

Any help be appreciated.

__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com

Re: [GENERAL] select max(oid)

От
Peter Eisentraut
Дата:
On Oct 22, soundar rajan mentioned:

> How do I
>
> select max(oid) from table;
>
> I'm able to to
> select max(fieldname) from tablename;
> but not max(oid).

There is no max function for the type oid. (Interestingly, casting it to
an int doesn't work either.) You could try to write your own (see help for
create aggregate). There appear to be < and > operators for the type, so
it shouldn't be too complicated.

--
Peter Eisentraut                  Sernanders vaeg 10:115
peter_e@gmx.net                   75262 Uppsala
http://yi.org/peter-e/            Sweden


Re: [GENERAL] select max(oid)

От
Bruce Momjian
Дата:
> On Oct 22, soundar rajan mentioned:
>
> > How do I
> >
> > select max(oid) from table;
> >
> > I'm able to to
> > select max(fieldname) from tablename;
> > but not max(oid).
>
> There is no max function for the type oid. (Interestingly, casting it to
> an int doesn't work either.) You could try to write your own (see help for
> create aggregate). There appear to be < and > operators for the type, so
> it shouldn't be too complicated.
>

Added to TODO:

    * Add max() for oid type

--
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026