-- sql_expression.sql
-- Appendix H, Oracle Database XE PHP Web Programming
-- by Michael McLaughlin
--
-- This script demonstrates how to query a single row and column
-- using an ANSI SQL:2003 subquery against single column.


SPOOL sql_expression.log

SET ECHO ON
SET FEEDBACK ON
SET NULL '<Null>'
SET PAGESIZE 999
SET SERVEROUTPUT ON

SELECT   COUNT(*)
FROM     ITEM
WHERE    item_type = (SELECT   common_lookup_id
                      FROM     common_lookup
                      WHERE    common_lookup_context = 'ITEM'
                      AND      common_lookup_type = 'XBOX');

SPOOL OFF