Skip to main content
Solved

How to generate auto numbers for different sets of rows in a table

  • October 16, 2017
  • 4 replies
  • 175 views

aguan
Contributor
Forum|alt.badge.img+11
  • Contributor

I have an Oracle table with rows organized in groups, each group with an unique attribute name, WELL_NAME, and sorted by an attribute, DEPTH. I want to add an attribute called SURVEY_NO that auto generates a sequential number for each row within each group, starting with 1, then 2, .. and end with the last row in that sorted group. So it will look like:

WELL_NAME DEPTH SURVEY_NO

name1 10 1

name1 20 2

name1 30 3

name2 10 1

name2 20 2

name3 30 3

Best answer by david_r

You can use a Counter with the counter name set to WELL_NAME:

View original
Did this help you find an answer to your question?

4 replies

david_r
Celebrity
  • Best Answer
  • October 16, 2017

You can use a Counter with the counter name set to WELL_NAME:


takashi
Influencer
  • October 16, 2017
david_r wrote:

You can use a Counter with the counter name set to WELL_NAME:

I thought it's the best answer, but it cannot be explained why the SURVEY_NO for the row of "name3" becomes 3...

 

 


david_r
Celebrity
  • October 16, 2017
takashi wrote:
I thought it's the best answer, but it cannot be explained why the SURVEY_NO for the row of "name3" becomes 3...

 

 

I just assumed it was a typo ;-)

aguan
Contributor
Forum|alt.badge.img+11
  • Author
  • Contributor
  • October 16, 2017
david_r wrote:

You can use a Counter with the counter name set to WELL_NAME:

David, yes it works perfect. Again glory to FME.

 

 

Sorry for the typo, Takashi.

 

 

Allen

 

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings