Re: Join question

Поиск
Список
Период
Сортировка
От Thomas A. Lowery
Тема Re: Join question
Дата
Msg-id 20030829010619.GB3426@stlowery.net
обсуждение исходный текст
Ответ на Join question  ("Williams, Travis L, NEO" <tlw@att.com>)
Список pgsql-general
Does using a union count as one query?

select a from tst_1 where b is null
union
select d from tst_2 t2 join tst_1 t1 on (t1.b = t2.c)
where t1.b is NOT null


On Thu, Aug 28, 2003 at 05:55:27PM -0400, Williams, Travis L, NEO wrote:
> Question,
>
> I have a table (1) with 2 col (a & b) where b can sometimes be null. I
> need a query that if B is null I get back the contents of A.. but if B
> is not null I do a join on it and table (2) col c to get the contents
> of table (2) col d.. I can do this in multiple queries.. but was
> wondering if I could do it in 1.


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

Предыдущее
От: jason dang
Дата:
Сообщение: Install PostgreSQL on AIX 5.1
Следующее
От: "Keow Yeong Huat Joseph"
Дата:
Сообщение: Re: Install PostgreSQL on AIX 5.1