Thursday, April 20, 2006

How many rows are there?

How many rows should the following query return?

select level as l
from dual
connect by level<=742

SQL*Plus may tell you 1 (one row):


TOAD may tell you 500 (more or exactly):

SQL Developer may tell you 10:

Maybe they should all start counting:

select count(*) from (
select level as l
from dual
connect by level<=742)

... and they all answer 742!

0 Comments:

Post a Comment

<< Home