SQLite Forum

select in order
Login
ORDER BY can specify multiple things to sort by.  
In this case, there is one thing to sort by for each ID.  

When the ID is 13 you are sorting by 1,0,0,0,0,0,0  
When the ID is  3 you are sorting by 0,1,0,0,0,0,0  
When the ID is  2 you are sorting by 0,0,1,0,0,0,0  
and so on.  

The id = <something> in the order by is an equal comparison, not assignment.