Jump to content
Changes to the Jaspersoft community edition download ×

SQL : Same serial number for a Group and should increment with group change


vspn

Recommended Posts

I want to display same sequence number for a group as shown in below example. Please help with SQL query

 

Ex: I have data as below in the table.

 

Facility   Store    Stop  

620592     S0722     1     

620578     S0308     2     

620578     S0631     3    

620590     S0678     4     

620590     S0444     5     

620590     S0237     6  

 

I need Sequence number for these record as

 

Facility Stop Sequence  

620592   1    1   

620578   2    2  

620578   3    2          

620590   4    3      

620590   5    3   

620590   6    3

 

Here Sequence should be based on group by Facility and order by Stop. Please help in creating sql query for this.

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • 3 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...