where clause subqueries vs multiple rows results

Поиск
Список
Период
Сортировка
I've a query which I'd have liked to word akin to:
 SELECT guid FROM child WHERE the_fkey =        ( SELECT id FROM parent WHERE name ~ 'some_regex' )        ORDER BY
the_fkey,my_pkey;
 

I got around it by doing the SELECT id first, and then doing a SELECT
guid for each row returned, appending the results together.

Can that be done in a single query, insead of 1+n queries?

Thanks,

-JimC
-- 
James Cloos <cloos@jhcloos.com>         OpenPGP: 0xED7DAEA6


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

Предыдущее
От: "Aaron Bono"
Дата:
Сообщение: Re: on connect/on disconnect
Следующее
От: Robert Edwards
Дата:
Сообщение: Re: on connect/on disconnect