Skip to content
Advertisement

SQLite Select data where the column name contains a string and create a table with those headers only

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. Many Thanks

Advertisement

Answer

If you want all the columns of old_table then you can do it like this:

If you want specific columns you must specify them on the select list:

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement