Tuesday, May 25, 2010

Rownum in 8.3 PostgreSQL

select rownum,columnname from(
SELECT ROWNUM, (a[ROWNUM]).columnname as columnAlias
FROM (
SELECT a, generate_series(1, array_upper(a, 1)) AS ROWNUM
FROM (
SELECT ARRAY
(
/*You complex query goes here*/
) AS a
) q2
) q3 ) q4 where /*Some where condition*/

No comments:

Post a Comment

Pages

About Me

My photo
- A competent M.S. Software Engineer and B.E. (Comp) with 6 years of rich experience in Java/ C / C++ / Oracle/PHP/Postgresql/Mysql in IT industry.
- Resourceful in developing Applications with various platforms and different domains.
A strategic planner with expertise in designing internal control systems towards the accomplishment of corporate business goals.
- A keen analyst with exceptional relationship management skills and abilities in liaising with different clients.
- Team player with excellent analytical and communications skills.
Worked with development projects with software brands like Cognizant and Infosys
Specialties
- Master in struts
- Good hands on in core Java
- Understanding of other building blocks of Enterprise applications like middle ware technologies.
- Knowledge of database like Oracle,postgresql,mysql