2 messages in com.mysql.lists.mysqlActual rowcount in the same resultset...
FromSent OnAttachments
Rob Vieira19 Jul 2002 11:10 
Egor Egorov20 Jul 2002 07:08 
Subject:Actual rowcount in the same resultset with a limited query
From:Rob Vieira (Rob.@netiq.com)
Date:07/19/2002 11:10:39 AM
List:com.mysql.lists.mysql

I need to provide a resultset where I've limited the number of rows, but where I know how many rows there would have been without the limit. While I know that there is a MySQL++ call for this, I'm wondering whether there is a way I can do this from Java, and, just as importantly, is there a way I can do it right within my resultset. In the case of SQL Server and Oracle, I can do it using a nested select with a COUNT(*) that has the same WHERE clause, but, since we don't have nested selects yet in MySQL, I'm stuck.

FYI, this is for use in doing a page "rows 76-100 of 598" kind of query. I want to grab the range of rows, but know where I am relative to the total.

Thanks,

Rob