Hi..
Hope below query helps you out..
sel
Serial_Number,
Send_Date ,
Count(*) as File_Count ,
Case When ( Max_Seq - Min_Seq ) + 1 = File_Count Then ' No' Else 'YES' END as Non_Seq_Flag,
Min (File_Number) as Min_Seq,
max( File_Number) as Max_Seq
from
<<Source_Table>>
group by
Serial_Number,
Send_Date
regards,
Rupesh
↧