MULTIPLE OUTER JOIN SYNTAX :-( can't quess it

Поиск
Список
Период
Сортировка
От Constantin Teodorescu
Тема MULTIPLE OUTER JOIN SYNTAX :-( can't quess it
Дата
Msg-id 3AED6EB6.6D808185@flex.ro
обсуждение исходный текст
Ответы Re: MULTIPLE OUTER JOIN SYNTAX :-( can't quess it  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-interfaces
Please excuse for my lack of imagination building SQL selects with OUTER
JOINS but something's unclear for me ...

I have 3 tables, t0, t1 and t2.

Tables are:
authors (alias t0) with (id int2, name text);
books (alias t1) with (author int2, title text);
nicknames (alias t2) with (id int2, nickname text);

I want a select query with them with 2 outer joins like that

t0.id = t1.author
t0.id = t2.id

Tried :
select t0.name, t1.title, t2.nickname from authors t0 left outer JOIN
books t1 ON (t0."id"=t1."author") , authors t0 left outer join nicknames
t2 on (t0."id"=t2."id") 

but it says "author table declared more than once".

with just 1 table it worked for me

Please, could you help me quickly showing me the right syntax?
I'm working to add outer joins to visual query builder in PgAccess.

Constantin Teodorescu
Braila, ROMANIA


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: function returning NULL?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: MULTIPLE OUTER JOIN SYNTAX :-( can't quess it