From: James Cloos <cloos@jhcloos.com>
To: pgsql-sql@postgresql.org
Subject: where clause subqueries vs multiple rows results
Date: Sun, 10 Sep 2006 23:27:59 -0400
Message-ID: <m3y7srm695.fsf@lugabout.jhcloos.org> (raw)
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: cloos@jhcloos.com
Subject: Re: where clause subqueries vs multiple rows results
In-Reply-To: <m3y7srm695.fsf@lugabout.jhcloos.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox