Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: Alternative to INTERSECT



On 7/31/07, Andreas Joseph Krogh <andreak(at)officenet(dot)no> 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%';



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group