top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration

Facebook Login
Site Registration

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

+2 votes
179 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.

Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...