Обсуждение: Novice trouble with plpgsql
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.
try: select max(name_of_column) from name_of_table; Regards, Patrik Kudo 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.
> 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@debis.com (Jan Wieck) #
Thank you all. Trouble was in column name - "day" :-)))))) Sorry for my stupid question. Bye