top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to find the number of records in a table without using count function?

+2 votes
641 views
How to find the number of records in a table without using count function?
posted Oct 6, 2015 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

Try This:

SELECT MAX(Row) FROM
(SELECT ROW_NUMBER() OVER(ORDER BY ID DESC) Row FROM USERS) UserQuery

But Count is Best Method.

answer Oct 6, 2015 by Manikandan J
select sum(1) as count from <table name>.
Similar Questions
+1 vote

which of the following is better to find the number of rows in a table?
1. count(1)
2. count(*)
3. count(rowid)

+2 votes

Its a very basic question but it would be good if anyone can answer with some explanations. When we type select * from dba_users; in sql plus it will show N rows selected and total records whereas when we type select * from employee it would show only records but not the total count.

+1 vote

I am building a small web application of online library and I want to find out the difference between issue date and Submission date of the books.
My sql table has 5 values
1) name
2) ID number
3) Issue date
4) Book
5) Submission Date.
please help me with the Sql Statement that i should use to solve this problem.

...