You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Andrey Rogov <ko...@gmail.com> on 2009/07/22 20:43:45 UTC
RE: size of paginated list
select count(*)
From your_table
<dynamic>
Your expression
</dynamic>
Before select.
-----Original Message-----
From: Odelya YomTov [mailto:odelya@jpost.com]
Sent: Wednesday, July 22, 2009 11:17 PM
To: user-java@ibatis.apache.org
Subject: size of paginated list
Hi!
I need to know the size of the paginated list (not per page).
Because if I do:
orderList.getPageSize - I get the amount of records per page, and I need to
know in general how many records are there in the database.
For example:
If my page size is 10, and the query should return 15, it should tell me 15
and not 10.
How can I do it?
Thanks|!
---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org
RE: size of paginated list
Posted by Andrey Rogov <ko...@gmail.com>.
For oracle you can write ( something like this )
select *
from (
select rownum as rnum ,
g.good ,
g.namerus ,
cnt.count
from servers.goods g ,
( select count(*) as count
from servers.goods g1
) cnt
where rownum <= #lastnum#
)
where rnum > #firstnum#
Read sql reference from your sql vendor.
Ps ( it's not ibatis forum question ).
-----Original Message-----
From: Odelya YomTov [mailto:odelya@jpost.com]
Sent: Wednesday, July 22, 2009 11:56 PM
To: user-java@ibatis.apache.org
Subject: RE: size of paginated list
Right
But I prefer not to call 2 different queries.. can I do it in one query?
-----Original Message-----
From: Andrey Rogov [mailto:konusdb@gmail.com]
Sent: Wednesday, July 22, 2009 9:44 PM
To: user-java@ibatis.apache.org
Subject: RE: size of paginated list
select count(*)
From your_table
<dynamic>
Your expression
</dynamic>
Before select.
-----Original Message-----
From: Odelya YomTov [mailto:odelya@jpost.com]
Sent: Wednesday, July 22, 2009 11:17 PM
To: user-java@ibatis.apache.org
Subject: size of paginated list
Hi!
I need to know the size of the paginated list (not per page).
Because if I do:
orderList.getPageSize - I get the amount of records per page, and I need to
know in general how many records are there in the database.
For example:
If my page size is 10, and the query should return 15, it should tell me 15
and not 10.
How can I do it?
Thanks|!
---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org
****************************************************************************
********
This footnote confirms that this email message has been scanned by
PineApp Mail-SeCure for the presence of malicious code, vandals & computer
viruses.
****************************************************************************
********
---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org
RE: size of paginated list
Posted by Odelya YomTov <od...@jpost.com>.
Right
But I prefer not to call 2 different queries.. can I do it in one query?
-----Original Message-----
From: Andrey Rogov [mailto:konusdb@gmail.com]
Sent: Wednesday, July 22, 2009 9:44 PM
To: user-java@ibatis.apache.org
Subject: RE: size of paginated list
select count(*)
From your_table
<dynamic>
Your expression
</dynamic>
Before select.
-----Original Message-----
From: Odelya YomTov [mailto:odelya@jpost.com]
Sent: Wednesday, July 22, 2009 11:17 PM
To: user-java@ibatis.apache.org
Subject: size of paginated list
Hi!
I need to know the size of the paginated list (not per page).
Because if I do:
orderList.getPageSize - I get the amount of records per page, and I need to
know in general how many records are there in the database.
For example:
If my page size is 10, and the query should return 15, it should tell me 15
and not 10.
How can I do it?
Thanks|!
---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org
****************************************************************************
********
This footnote confirms that this email message has been scanned by
PineApp Mail-SeCure for the presence of malicious code, vandals & computer
viruses.
****************************************************************************
********
---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org