I've read the IN chapter in Bruce M.'s Postgresql book, but I still can't
seem to get my select/IN to work. I have two tables, transactions and
transactions_detail, with the transaction_id field as the reference in
the transactions_detail table.
# select transaction_id from transactions where enter_date> cast('2002-02-22' as date);
transaction_id
----------------
2043
2044
2045
purchases=# select transaction_id from transactions_detail where transaction_id>2042;
transaction_id
----------------
2043
2044
2045
purchases=# \d transactions_detail
Table "transactions_detail"
Attribute | Type | Modifier
----------------+-----------------------+----------
transaction_id | smallint |
products | character varying(20) |
quantities | smallint |
But the following query causes it to hang, after 10 seconds I finally stop
it.
purchases=# select transaction_id from transactions_detail where
purchases=# transaction_id IN (
purchases=# select transaction_id from transactions where enter_date> cast('2002-02-22' as date)
purchases=# );
Any suggestions?
Thanks!
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Doug Silver
Network Manager
Quantified Systems, Inc
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~