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

Re: query question really cant give a summary here so read the body ;-)

From: "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com>
To: "Rhys Stewart" <rhys(dot)stewart(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: query question really cant give a summary here so read the body ;-)
Date: 2008-04-23 18:37:04
Message-ID: dcc563d10804231137x1cb03525r61632265e3396387@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-general
I'd say you need to rethink your schema.

On Wed, Apr 23, 2008 at 12:11 PM, Rhys Stewart <rhys(dot)stewart(at)gmail(dot)com> wrote:
> Hi all,
>
> have the following table
>
> aid    | bid
> --------------
> 1    |5
> 2    |6
> 3    |7
> 4    |9
> 5    |1
> 6    |2
> 7    |3
> 8    |10
> 9    |4
> 10  |8
> both aid & bid represent the same data in another table, but the table has
> duplicate data and i did a self-join to get the id's out. The question is
> how do i get a distinct listing between both columns
>
> like
> aid | bid
> -----------
> 1|5
> 2|6
> 3|7
> 4|9
> 10|8
>
> Have been racking my brain for the past hour....any suggestions?
>
> Thanks
> Rhys
>

In response to

Responses

pgsql-general by date

Next:From: cgastrellDate: 2008-04-23 18:45:19
Subject: Re: Trouble running PostgreSQL server / Server must be started under certain locale.
Previous:From: Tom LaneDate: 2008-04-23 18:33:52
Subject: Re: Create temporary function

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