Single SELECT vs. multiple SELECTs on UNrelated tables ??
From: Craig <clittle_at_valueamerica.com>
Date: 1996/10/03
Message-ID: <01bbb172$2aff8ec0$83e863ce_at_pc001.valueamerica.com>#1/1
Date: 1996/10/03
Message-ID: <01bbb172$2aff8ec0$83e863ce_at_pc001.valueamerica.com>#1/1
SELECT * FROM TABLE_A a, TABLE_B b where a.col1=1 and b.col1=99 [this
returns 1,2,3,98,99]
versus
SELECT * FROM TABLE_A a where a.col1=1 [this returns 1,2,3]
SELECT * FROM TABLEB b where b.col1=99 [this returns 98,99]
These are two absolutely unrelated tables and each return only one row for
the above specified conditions. So my question is:
which is more efficient: the one select or two selects?
To add more complexity, if this is a client/server application and you want
as few "across-the-network" calls to the database as possible, would the
single select have even greater merit. I would think so, but am interested
in input from the SQL world.
Thanks.
Chris Received on Thu Oct 03 1996 - 00:00:00 CEST