Re: help with pagila

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: Walter Cruz <walter(dot)php(at)gmail(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: help with pagila
Date: 2006-09-01 21:12:59
Message-ID: 20060901140554.N12215@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


On Fri, 1 Sep 2006, Walter Cruz wrote:

> Hi all. I'm with a little doubt.
>
> I'm testing the pagila (the postgres port of mysql sakila sample).
>
> Well, I was trying to translate the query:
>
> select
> film.film_id AS FID,
> film.title AS title,
> film.description AS description,
> category.name AS category,
> film.rental_rate AS price,
> film.length AS length,
> film.rating AS rating,
> group_concat(concat(actor.first_name,_utf8' ',actor.last_name)
> separator ',') AS actors
> from
> category
> inner join film on(category.category_id = film.category_id)
> inner join film_actor on(film.film_id = film_actor.film_id)
> inner join actor on(film_actor.actor_id = actor.actor_id)
> group by
> film.film_id;

Assuming that film_id is the primary key on film and category_id is the
primary key on category, I think you'd be allowed to have the other column
references in SQL03 (and 99?) but not in SQL92 (which is the version that
PostgreSQL currently implements).

IIRC, the later specs allow you to not mention columns in group by that
are functionally dependant on other columns that are mentioned.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Ezequias Rodrigues da Rocha 2006-09-02 20:42:29 Mac Address
Previous Message Walter Cruz 2006-09-01 20:46:02 Re: help with pagila