Ok, before 8.4, there I can use row_number().
For 8.3 + display tag + order by integer + paging based on pageBean
ArrayList alist;
In Bean.java, added:
private int rec_num;
in main .action java:
for(int i=0 ; i
Piotr Czekalski, 27.01.2011 16:21:
Gentelmen,
I follow this thread and I don't
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
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
Hi Oliveiros,
Howdy!
If it is to order in ascendent fashion by, say, lname,
one possibility would be
SELECT COUNT(b.*) as row_number, a.lname,a.gname
FROM "Table1" a, "Table2" b
WHERE a.lname >= b.lname
GROUP BY a.lname,a.gname
ORDER BY row_number
If you want to order by gname just chang
Hi Oliveiros,
If it is to order in ascendent fashion by, say, lname,
one possibility would be
SELECT COUNT(b.*) as row_number, a.lname,a.gname
FROM "Table1" a, "Table2" b
WHERE a.lname >= b.lname
GROUP BY a.lname,a.gname
ORDER BY row_number
If you want to order by gname just change the WHERE c
If it is to order in ascendent fashion by, say, lname,
one possibility would be
SELECT COUNT(b.*) as row_number, a.lname,a.gname
FROM "Table1" a, "Table2" b
WHERE a.lname >= b.lname
GROUP BY a.lname,a.gname
ORDER BY row_number
If you want to order by gname just change the WHERE clause according
Hi, Lu Ying.
How do you define which row is #1 ? And #2 ?
E.g. Ordered by lname? Or gname...?
Best,
Oliveiros
- Original Message -
From: "Emi Lu"
To:
Sent: Wednesday, January 26, 2011 4:11 PM
Subject: [SQL] how to get row number in select query
Good morning,
For postgresql 8.3