SQL question - duplicate records from join

Поиск
Список
Период
Сортировка
От Raymond O'Donnell
Тема SQL question - duplicate records from join
Дата
Msg-id 3C7E7B0F.16439.137F870@localhost
обсуждение исходный текст
Ответы Re: SQL question - duplicate records from join
Список pgsql-general
Hi all,

I recently upgraded to Postgres 7.1 (having finally found the correct
pg_dump!), and now I notice that joins are returning duplicate
records. A typical query would be:

  select i.itemcode, i.itemname, d.deptname, r.roomname
  from items i
    inner join departments d on (i.deptcode=d.deptcode)
    inner join rooms r on (i.roomcode=r.roomcode)
  where... (etc)

This query returns four copies of each record, where before I just
got one as I'd expect. Am I doing something wrong here?

Thanks for all your help.

--Ray.


--------------------------------------
Raymond O'Donnell
rod@iol.ie
rod@gti.ie
--------------------------------------

В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Defunct postmasters
Следующее
От: Holger Marzen
Дата:
Сообщение: Re: Defunct postmasters