Re: Simple OUTER JOIN doubt

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Sandro Dentella <sandro(at)e-den(dot)it>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Simple OUTER JOIN doubt
Date: 2006-10-27 19:55:35
Message-ID: 8937.1161978935@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Sandro Dentella <sandro(at)e-den(dot)it> writes:
> I only get films for which a vote was expressed. My query:

> SELECT f.id, f.titolo, p.voto
> FROM film_film f
> LEFT OUTER JOIN vota_punteggio p
> ON (f.id = p.film_id)
> WHERE
> (p.user_id = 2 OR p.user_id IS NULL)

> Can you help me understanding what is wrong?

[ scratches head... ] Looks all right to me. Are you sure you copied
what you typed accurately? Does EXPLAIN show that a left join is being
used?

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message km 2006-10-27 20:06:57 Re: plpython
Previous Message Steve Atkins 2006-10-27 19:47:29 Re: Stripping empty space from all fields in a table?