Skip to main content
Solved

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

  • October 16, 2017
  • 4 replies
  • 199 views

aguan
Supporter
Forum|alt.badge.img+11
  • Supporter
  • 140 replies

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:

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

4 replies

david_r
Celebrity
  • 8394 replies
  • Best Answer
  • October 16, 2017

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


takashi
Celebrity
  • 7843 replies
  • October 16, 2017

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
  • 8394 replies
  • October 16, 2017
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
Supporter
Forum|alt.badge.img+11
  • Author
  • Supporter
  • 140 replies
  • October 16, 2017

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