RE: SQL question

From: Powell, Mark <mark.powell2_at_hp.com>
Date: Wed, 24 Oct 2012 19:18:53 +0000
Message-ID: <1E24812FBE5611419EFAFC488D7CCDD112159493_at_G5W2734.americas.hpqcorp.net>



Any change there the difference in the two queries is just due to DML activity on the target tables?

-----Original Message-----

From: oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Ramadoss, Karthik Sent: Wednesday, October 24, 2012 3:01 PM To: oracle-l_at_freelists.org
Subject: SQL question

This is probably a simple one but definitely something new for me. Database: 11.2.0.3
OS: Oracle Linux 5.6

A SQL like

              SELECT A.COL1,
                     A.COL2,
                     B.COL3
                FROM TABLE1 A,
                     TABLE2 B,
                     TABLE3 C
               WHERE A.ID = B.ID AND B.ID = C.ID

returns 1,192,940 rows.

And

        SELECT COUNT(*) from
      (SELECT A.COL1,
                     A.COL2,
                     B.COL3
                FROM TABLE1 A,
                     TABLE2 B,
                     TABLE3 C
               WHERE A.ID = B.ID AND B.ID = C.ID)

Returns 1,192,978 rows.

Anyone know what is going on here? I would expect both to return the same number of rows.

--

http://www.freelists.org/webpage/oracle-l

--

http://www.freelists.org/webpage/oracle-l Received on Wed Oct 24 2012 - 21:18:53 CEST

Original text of this message