Re: Function to Pivot data - Mailing list pgsql-general

From Stephan Szabo
Subject Re: Function to Pivot data
Date
Msg-id 20020131132154.V17097-100000@megazone23.bigpanda.com
Whole thread Raw
In response to Re: Function to Pivot data  (Ellen Cyran <ellen@urban.csuohio.edu>)
Responses Re: Function to Pivot data  (Ellen Cyran <ellen@urban.csuohio.edu>)
List 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?


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: going crazy with serial type
Next
From: Jan Wieck
Date:
Subject: Re: going crazy with serial type