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 thanks -- View this message in context: http://www.nabble.com/select-max-from-subquery-tp22011562p22011562.html Sent from the PostgreSQL - general mailing list archive at Nabble.com. -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general