On 7/31/07, Andreas Joseph Krogh <[EMAIL PROTECTED]> wrote:
> Is there a way to make this more efficient with another construct, or
> INTERSECT the only way to accomplish the desired result?
SELECT f1.ID
FROM TEST f1 JOIN TEST f2 ON f1.ID = f2.ID
JOIN TEST f3 ON f2.ID = f3.ID
WHERE f1.FIELD = 'firstname'
AND f1.VALUE LIKE 'andrea%'
AND f2.FIELD = 'firstname'
AND f2.VALUE LIKE 'jose%'
AND f3.FIELD = 'lastname'
AND f3.VALUE LIKE 'kro%';
---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?
http://archives.postgresql.org