Previous Topic: Name ChangeNext Topic: Common Table Expression


Probing the Table Twice

The following example gets better index access, but it will probe the table twice.

SELECT PERSON_ID
FROM   PERSON_TBL
WHERE  LASTNAME = 'RADY'
AND    FIRST_NAME = 'BOB'
UNION ALL
SELECT PERSON_ID
FROM   PERSON_TBL
WHERE  LASTNAME = 'BOB'
AND    FIRST_NAME = 'RADY'