Following from the answer to this question: SQLite Select data where the column name contains a string? I would like to know how to create a table with these new columns obtained from the previous table. I wrote something like this (Please ignore the WHERE statement): however, it is not working. Any help in this direction would be much appreciated.