I need to split big table to small table and write it to csv.
used_at                                    4                  5                      6
address                          10ruslake.ru 1c.ru    vk.com  yandex.ru  youtube.com  facebook.com   
ID                                                                     
0025977ab2998580d4559af34cc66a4e          0.0   0.0      152      465          45           56       
00c651e018cbcc8fe7aa57492445c7a2          0.0   0.0      23       213          354          44   
0120bc30e78ba5582617a9f3d6dfd8ca          0.0   0.0      0        100          109          0
I need write to the first table all means, where used_at = 4, to second used_at = 5 etc.
I want to get the First table
used_at                                    4  
address                          10ruslake.ru 1c.ru
ID
0025977ab2998580d4559af34cc66a4e          0.0   0.0
00c651e018cbcc8fe7aa57492445c7a2          0.0   0.0
0120bc30e78ba5582617a9f3d6dfd8ca          0.0   0.0
Second
used_at                                        5  
address                                 vk.com    yandex.ru
ID
0025977ab2998580d4559af34cc66a4e          152      465
00c651e018cbcc8fe7aa57492445c7a2          23       213
0120bc30e78ba5582617a9f3d6dfd8ca          0        100
And also to used_at = 6
