Re: Subqueries in select clause - Mailing list pgsql-sql

From Josh Berkus
Subject Re: Subqueries in select clause
Date
Msg-id web-41185@davinci.ethosmedia.com
Whole thread Raw
In response to Subqueries in select clause  (Sara Cohen <sarina@cs.huji.ac.il>)
Responses Re: Subqueries in select clause
List pgsql-sql
Sara,

Hey!   Great to see that Postgres has made it to Israel.  What's the
most popular Linux distribution there?

I think you have your answer ... an upgrade.  RPMs for most major
distributions of Linux should be available within the week.

Until you can upgrade, though, try this approach:

CREATE VIEW c_aggregate AS
SELECT sum(a) as sum_a, b FROM c GROUP BY b;

SELECT max(sum_a) FROM c_aggregate;

Not as fast or dynamic as a subselect, but should solve your immediate
problem.

-Josh Berkus


______AGLIO DATABASE SOLUTIONS___________________________                                      Josh Berkus Complete
informationtechnology      josh@agliodbs.com  and data management solutions       (415) 565-7293 for law firms, small
businesses       fax 621-2533   and non-profit organizations.      San Francisco
 


pgsql-sql by date:

Previous
From: "Josh Berkus"
Date:
Subject: Re: maybe Offtopic : PostgreSQL & PHP ?
Next
From: Mathijs Brands
Date:
Subject: Re: maybe Offtopic : PostgreSQL & PHP ?