Re: Comments on subquery performance

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: Comments on subquery performance
Дата
Msg-id 4214ED42.5040802@archonet.com
обсуждение исходный текст
Ответ на Comments on subquery performance  ("T- Bone" <jbowen333@hotmail.com>)
Ответы Re: Comments on subquery performance  ("T- Bone" <jbowen333@hotmail.com>)
Список pgsql-sql
T- Bone wrote:
> (second attempt in two days to post this message...I appologise if for 
> some reason a duplicate appears)
> 
> Hello all,
> 
> I created a query that contains two subqueries and joins and would like 
> some feedback on whether:
>  1) this approach is logical; and,
>  2) if this is an optimal approach (performance wise) to return the 
> records I seek.

Well you could just do:

SELECT  l.*, c1.catname, c2.catname, c3.catname
FROM  tbl_listing l,  tbl_categories c1,  tbl_categories c2,  tbl_categories c3
WHERE  l.catid1 = c1.catid  AND l.catid2 = c2.catid  AND l.catid3 = c3.catid

--   Richard Huxton  Archonet Ltd


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: pg primary key bug?
Следующее
От: pginfo
Дата:
Сообщение: Re: pg primary key bug?