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

0
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.
vspn's picture
19
Joined: Mar 14 2014 - 1:20pm
Last seen: 1 year 3 months ago

2 Answers:

0

SQL syntax is dependent on the database you're using.

Should post your question to the forum for the database you're using instead of JasperReports forum.

 

hozawa's picture
44159
Joined: Apr 24 2010 - 4:31pm
Last seen: 1 month 5 days ago
0

Is it possible to generate sequence as mentioned above in through iReport designer? If so, can you please suggest how to do it..

vspn's picture
19
Joined: Mar 14 2014 - 1:20pm
Last seen: 1 year 3 months ago
Feedback
randomness