Re: SELECT Query

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: SELECT Query
Дата
Msg-id 20021101121455.GD26650@svana.org
обсуждение исходный текст
Ответ на SELECT Query  (Scott Taylor <scott.taylor@4i-dotcom.com>)
Список pgsql-general
On Fri, Nov 01, 2002 at 11:58:23AM +0000, Scott Taylor wrote:
> Below is the result of a query on my table. I want to only return those
> transactions that have a chart_id=10074, and if trans_id 10088 is one of
> those, I want to return all 3 rows with that trans_id.

Hmm...

select * from acc_trans where trans_id in
    (select trans_id from acc_trans where chart_id = 10074);

You can rewrite that as an EXISTS query, but it should work fine.

Hope this helps,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> There are 10 kinds of people in the world, those that can do binary
> arithmetic and those that can't.

Вложения

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

Предыдущее
От: Scott Taylor
Дата:
Сообщение: SELECT Query
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: SELECT Query