I have table1 which contains ids [s1,s2,s3..Sn]
s1
s2
s3
I have another table2 containing indexes [0,1,2,..n].
0
1
2
3
I have third table3 [ids, start_index,stop_index]. eg:
s0 | 1 | 3 |
s0 | 4 | 6 |
s1 | 1 | 2 |
and so on. I want to create a pivot table which contains rows a s1,s2,s3... columns with 0,1,2,3.. content of the table should be either zero or 1.
---|0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |...
s0 |0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 |
s1 |0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 |
.
.