User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 426,660 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 1,521 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MySQL advertiser: Programming Forums
Views: 926 | Replies: 1
Reply
Join Date: Mar 2008
Location: Bangalore
Posts: 31
Reputation: rashmigs84 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
rashmigs84's Avatar
rashmigs84 rashmigs84 is offline Offline
Light Poster

to get the number of rows selected

  #1  
Mar 15th, 2008
hi ,

M facing the problem to get first 4 rows from the table .
m using sql2000. i used count but it is showing total no of rows in a table .
please let me know the query used to display rowcount.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Aug 2005
Location: near St Louis, Missouri, USA
Posts: 11,189
Reputation: Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of 
Rep Power: 38
Solved Threads: 931
Moderator
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Most Valuable Poster

Re: to get the number of rows selected

  #2  
Mar 15th, 2008
The only way to get the exact row count of the number of rows returned by a query is to count them as they are retrieved. Before starting to retrieve rows the db server knows whether or not there are more than zero rows, but doesn't know exactly how many until they have all been retrieved.
Last edited by Ancient Dragon : Mar 15th, 2008 at 7:27 am.
I think it's about time we voted for senators with breasts. After all, we've been voting for boobs long enough. ~Clarie Sargent, Arizona senatorial candidate
Those who are too smart to engage in politics are punished by being governed by those who are dumber. ~Plato
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb MySQL Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the MySQL Forum

All times are GMT -4. The time now is 1:48 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC