Re: Display of text fields

Поиск
Список
Период
Сортировка
Искать
От
Ennio-Sr
Тема
Re: Display of text fields
Дата
Msg-id
20040910175501.GA9535@deby.ei.hnet
Ответ на
Список
Дерево обсуждения
Display of text fields Ennio-Sr <nasr.laili@tin.it>
Re: Display of text fields Richard Huxton <dev@archonet.com>
Re: Display of text fields Ennio-Sr <nasr.laili@tin.it>
Re: Display of text fields Ennio-Sr <nasr.laili@tin.it>
Re: Display of text fields Richard Huxton <dev@archonet.com>
Re: Display of text fields Ennio-Sr <nasr.laili@tin.it>
Re: Display of text fields Stephan Szabo <sszabo@megazone.bigpanda.com>
Re: Display of text fields Richard Huxton <dev@archonet.com>
Re: Display of text fields Ennio-Sr <nasr.laili@tin.it>
* Stephan Szabo  [100904, 10:39]:
> On Fri, 10 Sep 2004, Ennio-Sr wrote:
> > > > * Stephan Szabo  [100904, 07:10]:
> > > > > On Fri, 10 Sep 2004, Ennio-Sr wrote:
> > > > > [ big cut ]
> > >
> 
> Well, I'd expect that for large tables the outer join type solution would
> tend to be faster than joining every row to every other row and then using
> a unique step (probably after a sort) to basically remove the ones you
> don't want. If you try different solutions, you can use EXPLAIN ANALYZE to
> compare query plans.

Please forget my previous message: I've just finished trying your
'COALESCE' solution (prior to studying it ;) ) and it seems to work
greatly!

---------
SELECT 
t0.a, t0.b, t0.c, COALESCE(t1.d, ' ') as note from foo t0 left OUTER
JOIN foo_d t1 on (t0.has_d = 'Y' AND t0.a=t1.a); 

# the result is:

 a |  b   |   c    |               note               
---+------+--------+----------------------------------
 1 | one  | number | is the first natural
 2 | two  | number | follows 1 in the seq of natural
 3 | tree | name   | there are various qualities of -
 4 | blue | color  |  
 5 | john | person |  
(5 rows)
^^^
---------
Perfect, I would say :-)
Thank you again so much indeed, Stephan.
	Ennio.

-- 
[Perche' usare Win$ozz (dico io) se ..."anche uno sciocco sa farlo.     \\?//
 Fa' qualche cosa di cui non sei capace!"   (diceva Henry Miller) ]     (°|°)
[Why to use Win$ozz (I say) if ... "even a fool can do that.             )=(
 Do something you aren't good at!" (used to say Henry Miller) ]
В списке pgsql-general по дате отправления
От: Stephan Szabo
Дата:
Сообщение: Re: Display of text fields
От: Chris Ochs
Дата:
FAQ