Re: select max from subquery - Mailing list pgsql-general

From Oleg Bartunov
Subject Re: select max from subquery
Date
Msg-id Pine.LNX.4.64.0902141840480.31919@sn.sai.msu.ru
Whole thread Raw
In response to select max from subquery  (searchelite <searchelite@gmail.com>)
Responses Re: select max from subquery
List pgsql-general
yOn Sat, 14 Feb 2009, searchelite wrote:

>
> Dear All
>
> i gave this kind of query
>
> select max(foo) from (select some statement) as foo
>
> but it gave me this error
> ERROR:  function max(record) does not exist
>
>
> any help how i can select max value from suqbuery in main query
>

like this:

select max(foo.qq) from (select 1 as qq) as foo;
                                   ^^ ^^

> thanks
>

     Regards,
         Oleg
_____________________________________________________________
Oleg Bartunov, Research Scientist, Head of AstroNet (www.astronet.ru),
Sternberg Astronomical Institute, Moscow University, Russia
Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(495)939-16-83, +007(495)939-23-83

pgsql-general by date:

Previous
From: Onno Molenkamp
Date:
Subject: Re: currval() in insert statements
Next
From: Raymond O'Donnell
Date:
Subject: Re: currval() in insert statements