Re: Novice trouble with plpgsql

From: wieck(at)debis(dot)com (Jan Wieck)
To: Patrik Kudo <kudo(at)partitur(dot)se>
Cc: Alexander Stetsenko <as(at)anapa(dot)org(dot)ru>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Novice trouble with plpgsql
Date: 2000-04-03 20:23:58
Message-ID: m12cDOA-0003kGC@orion.SAPserv.Hamburg.dsh.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> try:
>
> select max(name_of_column) from name_of_table;
>
> Regards,
> Patrik Kudo

He said PL/pgSQL!

Try

var := max(col) from table;

instead. Looks a little odd, but should work.

>
> Alexander Stetsenko wrote:
> >
> > Hello All
> > Help me please !
> > I need to select max value in plpgsql, but
> > such code seems is not corect:
> > select into var max(col) from table ;
> > How can I do this ?
> >
> > Thanks you all.
>
>

Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#========================================= wieck(at)debis(dot)com (Jan Wieck) #

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Joseph Shraibman 2000-04-03 20:28:58 Re: Can't access a table. It seems to have been corrupted hsomehow
Previous Message Mark Dalphin 2000-04-03 19:36:03 Re: Hash Indexes. (Was: planner complaints)