Re: Function to Pivot data

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Ellen Cyran <ellen(at)urban(dot)csuohio(dot)edu>
Cc: Andrew Sullivan <andrew(at)libertyrms(dot)info>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Function to Pivot data
Date: 2002-01-31 21:22:33
Message-ID: 20020131132154.V17097-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 31 Jan 2002, Ellen Cyran wrote:

> I've run the SQL statement below and it doesn't give me
> what I thought and even gives me some incorrect data.
> Any idea why?
>
> Here's my version of the statement:
>
> SELECT a.title, b.Author AS auth1, c.author AS auth2
> FROM book AS a, tbl_author AS b, tbl_author AS c, author_book AS d,
> author_book AS e
> WHERE a.bookID=d.bookID And b.authorID=d.authorid And d.auth_rank=1 And
> c.authorID=e.authorid And e.auth_rank=2;

Shouldn't you be checking a.bookid=e.bookid as well or am I missing
something?

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Patrick Welche 2002-01-31 21:25:33 pgreplication
Previous Message Jan Wieck 2002-01-31 21:21:54 Re: going crazy with serial type