I need to find frequency of sequences of data rows.I have like 17000 rows data which is including almost 120 different kind of data and I need to find which sequences of data how many times repeated?
For instance:
a
b
c
a
b
d
a
b
c
I am trying to find repetition order some people call it frequency sequence. So how many times aa and abc and ab and bc and abca and so on are there in this column? I mean I need to find how many times this data has same group of rows.
For this example it has 4 different data so there are a lot of combination of it. For calculation: C(4,1)*4!+C(4,2)*2!+C(4,3)*3!+C(4,4) different order and I need to calculate it for each order how many times are there?
My short part of real column data example:(each contiguous data is equal to a row)
3E010000
2010000
2010007
2010008
2010000
2010003
2010009
0201000A
0B01000C
2010002
3E010000
2010000
2010007
0B010014
2010009
0201000A
0B01000C
2010002
Now if you could check this whole main column for this group of data:
3E010000
2010000
2010007
and this
3E010000
2010000
and this
2010009
0201000A
0B01000C
2010002
and so on. You can see they were repeated more than once.
These rows repeat in the main first column and I am trying to find 1,2,3,4 and max 5 groups of orders out of 120 kind of data combination.
I am using Microsoft SQL Server 2014. But if it is not possible in Microsoft SQL Server, then you could give me any advice or other tools. Could you help me please? Thank you so much!
Output:
0B010009 ,0B010009,0B010009,2010005,2010005,2010005 2 9
0B010014 ,0B010014,0B010014,16010002,16010002,16010002 2 3
2010002,2010002,0201FFE0,0201FFE0 2 13
0B0114B5 ,0B0114B5,0B0114B5,2010002,2010002,2010002,2010004,2010004,2010004 3 3
070105B3 ,070105B3,070105B3,2010005,2010005,2010005,0201FFE1 ,0201FFE1,0201FFE1
3 2
3E010000 ,3E010000,3E010000,0B010010,0B010010,0B010010 ,0B01F61D ,0B01F61D,0B01F61D 3 6
3E010002 ,3E010002,3E010002,0B010013,0B010013,0B010013 ,0B01F80D ,0B01F80D,0B01F80D 3 3
0B010003 ,0B010003,2010006,2010006,0B01000A ,0B01000A,2010005,2010005 4 2
0B01FFE1 ,0B01FFE1,0B01FFE1,0B010013,0B010013,0B010013 ,0B01EAD0 ,0B01EAD0,0B01EAD0,0B010004,0B010004,0B010004 4 4
0B01000C ,0B01000C,0B01000C,0B01FCBD,0B01FCBD,0B01FCBD ,0701FFE0 ,0701FFE0,0701FFE0,0B01000A,0B01000A,0B01000A 4 5