Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-novice by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group