1

Currently I´m doing this (get pagination and count), in Informix:

select a.*, b.total from (select skip 0 first 10 * from TABLE) a,(select count(*) total from TABLE) b

The problem is that I´m repeating the same pattern - I get the first ten results from all and then I count all the results.

I want to make something like this:

select *, count(*) from TABLE:

so I can make my query much faster. It is possible?

Goldbones
  • 1,407
  • 3
  • 21
  • 55
  • Am I interpreting your use of the keyword TABLE correctly if I assume that within your question, it should be regarded as a surrogate for some specific table in your database, rather than as a keyword? Why do you want the total count with each row? What's the repetition? You can provide placeholders for the SKIP and FIRST values AFAIK. – Jonathan Leffler Dec 10 '15 at 21:45
  • http://stackoverflow.com/questions/18119463/better-way-for-getting-total-count-along-with-paging-in-sql-server-2012 – Goldbones Dec 17 '15 at 10:14

0 Answers0