Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 438319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T20:39:59+00:00 2026-05-12T20:39:59+00:00

some time ago I happend to resolve a PG related problem with this SO

  • 0

some time ago I happend to resolve a PG related problem with this SO question of mine.
Basically it’s about using row_number over a partition in 8.4.

Sadly now I have to create the same thing for 8.2 since one of my customers is on
8.2 and needs it desperatly.

What I do know (on 8.4) is the following:

SELECT custId, custName, 'xyz-' || row_number() OVER (PARTITION by custId) 
AS custCode

Basically counting the occurances of custId and assigning custCodes from that.
(just an example, to show what I to; of course the query is way more complex)

I figured the solutions provided to the question mentioned above, but did’nt get them
working since there’s one more hurdle to take. I don’t run SQL directly I have to
embed it into a xml based config file which creates a certain xml format from the query
results. So creating temp stuff or procedures is not really an option.

So here’s the question, does anyone of you guys have an idea how to port that solution of
mine to PG 8.2?

TIA

K

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T20:39:59+00:00Added an answer on May 12, 2026 at 8:39 pm

    use depesz solution http://www.depesz.com/index.php/2007/08/17/rownum-anyone-cumulative-sum-in-one-query/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I asked this question about using the system-drawables in an Android-app some time ago:
Some time ago i posted a question related to a WriteableBitmap memory leak, and
I've been coding for years but some time ago I asked myself this question.
Some time ago I was asked the strange question how would I implement map
Some time ago I created this LAMP based web. At the time I wrote
Some time ago (~4-5months ago) I attented a lecture about Java EE and at
Some time ago I've been thinking about how to hide from default page of
Solved this ages ago, but this question recently got some attention so I'm adding
Some time ago, when I was using Janus, I could autocomplete Ruby code. I
Some time ago, I read that comparing version numbers can be done using the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.