Ok, before 8.4, there I can use row_number().

For 8.3 + display tag + order by integer + paging based on pageBean

ArrayList<Bean> alist;

In Bean.java, added:

private int rec_num;

in main .action java:

for(int i=0 ; i<alist.size; i++)
{
   Bean(i).setRec_num = (i+1);
  ...
}


This will let displaytag show rec num successfully.

--
Lu Ying





On 01/27/2011 10:30 AM, Thomas Kellerer wrote:
Piotr Czekalski, 27.01.2011 16:21:
Gentelmen,

I follow this thread and I don't exactly get an idea of yours, but
isn't is as simple as (example: table "web.files" contains one column
named "fileurl" ):

select row_number() over(), X.fileurl from (select fileurl from
web.files order by fileurl) X

The only disadvantage is that if you do want to order resultset you
have to use "select from select" as numbers are added before order
which may cause some performance troubles.


You can get the row_number() without using the sub-select and without
ordering the whole result as you can specify the order in the over()
clause:

select fileurl
row_number() over (order by fileurl)
from web.files

Regards
Thomas




--
Emi Lu, ENCS, Concordia University, Montreal H3G 1M8
em...@encs.concordia.ca        +1 514 848-2424 x5884

--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql

Reply via email to