Page 1 of 1

count

Posted: Tue Aug 11, 2009 10:00 am
by g_suri24
SQL>SELECT COUNT(1) FROM DUAL;

what is the output of this query and how does it happen.Please explain.

thanks in advance.........

Posted: Sat Aug 15, 2009 2:07 am
by amirtai
SQL> select count(1)
2 from dual;

COUNT(1)
----------
1

Because there's just one column and one row that's why you'll always get 1. Here's what inside the DUAL table.

SQL> select * from dual;

D
-
X

Regards
Amir

Posted: Sat Aug 15, 2009 4:03 am
by admin
What exactly the question is? tks