I want to to convert data from long to wide format in SQLite, when the number of keys (to-be columns) is very large. There are two relevant questions, one that provides a very good answer fro MySQL (Mysql, reshape data from long / tall to wide) and another one that specializes it for SQLite (SQLite long to wide formats?), but in both cases you have to manually note the keys. In my case, keys are a few hundreds, so it is not possible to do it manually. Can you think of an automated solution? Thank you!
Asked
Active
Viewed 474 times
3
-
2Just take any programming language that you know and has bindings to appropriate database, select all keys and generate the table definition and the insert. SQL itself can't do it. – Jan Hudec Jan 15 '16 at 10:22
-
Thanx @JanHudec, I'll try the workaround... – User800701 Jan 15 '16 at 10:28