Re: Help with Select Statement

From: Nabil Sayegh <postgresql(at)e-trolley(dot)de>
To: Kevin Lohka <klohka(at)aboutfacedata(dot)ab(dot)ca>
Cc: pgsql-novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Help with Select Statement
Date: 2004-04-08 06:40:14
Message-ID: 4074F3CE.9040409@e-trolley.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Kevin Lohka wrote:
> Thanks for you response Nabil, I'm not sure if it solves my problem as
> there may be multiple records in the "bar" table, but I'll work through it.

There are several ways to return only 1 result out of many:
GROUP BY ( for aggregate functions like max, min, avg )
DISTINCT ( quick & dirty ;)
LIMIT ( probably together with ORDER BY cut the result )

And remember: whenever you run into a hopeless situation: you can still use
subqueries in postgresql :)

--
e-Trolley Sayegh & John, Nabil Sayegh
Tel.: 0700 etrolley /// 0700 38765539
Fax.: +49 69 8299381-8
PGP : http://www.e-trolley.de

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Sheeraz fazal 2004-04-08 19:17:38 How to call a function of PL/pgSQL
Previous Message Tom Lane 2004-04-08 01:17:06 Re: pg_dump filling up root directory