Richard Huxton wrote:
SELECT id FROM p4_versions WHERE
(versionof, version) IN (SELECT id,headver FROM p4_files WHERE ...)
Ahh, just what I was looking for...
Thanks All!
Mark
---(end of broadcast)---
TIP 4: Have you searched our list archives
why not a join like below (not tested)
select id
from p4_versions a
join p4_files b on (a.versionof = b.id and a.version = b.headver)
where p4path like '%/date.txt'
-- Original Message ---
From: Mark Harrison <[EMAIL PROTECTED]>
To: Postgresql-General
Sent: Thu, 27 Apr 2006 09
Mark Harrison <[EMAIL PROTECTED]> writes:
> I've got a query that depends upon two pieces of data from another table for
> use in a where clause.
> scratch1=# select id from p4_versions where
> versionof=(select id from p4_files where p4path like '%/date.txt')
> and
>
Mark Harrison wrote:
### QUERY 3: combine the two statements above by using two subselects
scratch1=# select id from p4_versions where
versionof=(select id from p4_files where p4path like
'%/date.txt')
and
version=(select headver from p4_files where p4path li