Home » SQL & PL/SQL » SQL & PL/SQL » need query without using func
icon5.gif  need query without using func [message #265464] Thu, 06 September 2007 06:53 Go to next message
balaji23_d
Messages: 123
Registered: February 2007
Senior Member
Hi all,

I need query how to count the number of rows in a table without using aggreggate functions?
Re: need query without using func [message #265466 is a reply to message #265464] Thu, 06 September 2007 06:55 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
But, Oracle designed the COUNT function to help us count records in a table. What's wrong with it?
Re: need query without using func [message #265470 is a reply to message #265466] Thu, 06 September 2007 07:04 Go to previous messageGo to next message
dhananjay
Messages: 635
Registered: March 2002
Location: Mumbai
Senior Member
hi,

analyze your table and then query the user_tables <num_rows> column.

regards,
Re: need query without using func [message #265492 is a reply to message #265464] Thu, 06 September 2007 07:31 Go to previous messageGo to next message
joy_division
Messages: 4963
Registered: February 2005
Location: East Coast USA
Senior Member
Do a SELECT * and then read the line that says "x rows selected"
Re: need query without using func [message #265496 is a reply to message #265464] Thu, 06 September 2007 07:41 Go to previous messageGo to next message
muzahid
Messages: 281
Registered: September 2004
Location: Dhaka, Bangladesh
Senior Member
In select clause add rownum dummy column and then last rownum is the number of your rows
Re: need query without using func [message #265595 is a reply to message #265492] Thu, 06 September 2007 12:36 Go to previous messageGo to next message
Frank
Messages: 7901
Registered: March 2000
Senior Member
joy_division wrote on Thu, 06 September 2007 14:31
Do a SELECT * and then read the line that says "x rows selected"

If you want just a single line of output (hey, displaying all those records can be tedious) do a delete <your_table> and read the line x rows deleted as joy_division suggested
Re: need query without using func [message #265669 is a reply to message #265595] Thu, 06 September 2007 21:56 Go to previous messageGo to next message
rleishman
Messages: 3728
Registered: October 2005
Location: Melbourne, Australia
Senior Member
/forum/fa/449/0//forum/fa/449/0//forum/fa/449/0//forum/fa/449/0//forum/fa/449/0//forum/fa/449/0//forum/fa/449/0//forum/fa/449/0//forum/fa/449/0//forum/fa/449/0//forum/fa/449/0//forum/fa/449/0//forum/fa/449/0//forum/fa/449/0//forum/fa/449/0//forum/fa/449/0/
Ouch. I hurt now...
Re: need query without using func [message #265683 is a reply to message #265595] Fri, 07 September 2007 00:36 Go to previous message
Michel Cadot
Messages: 68737
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator

Laughing Laughing Laughing Laughing Laughing Laughing Laughing Laughing Laughing

Michel
Previous Topic: Loop function between dates
Next Topic: document on TYPE
Goto Forum:
  


Current Time: Fri Feb 14 15:55:18 CST 2025