| From: | Oleg Bartunov <oleg(at)sai(dot)msu(dot)su> | 
|---|---|
| To: | searchelite <searchelite(at)gmail(dot)com> | 
| Cc: | pgsql-general(at)postgresql(dot)org | 
| Subject: | Re: select max from subquery | 
| Date: | 2009-02-14 15:41:19 | 
| Message-ID: | Pine.LNX.4.64.0902141840480.31919@sn.sai.msu.ru | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | 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(at)sai(dot)msu(dot)su, http://www.sai.msu.su/~megera/
phone: +007(495)939-16-83, +007(495)939-23-83
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Carlos Henrique Reimer | 2009-02-14 16:34:30 | Track a function | 
| Previous Message | Onno Molenkamp | 2009-02-14 13:50:22 | Re: currval() in insert statements |