I am trying to copy all values from one table to another table. I am using SQlite. I have multiple columns with the following column names - name,accounts,email, 12/30/2016,01/13/2017.... All columns are named as dates except for the first 3 columns. I am trying to copy using this statement:
PreparedStatement prepCopy = con
.prepareStatement("INSERT INTO table1(12/30/2016) SELECT 12/30/2016 FROM table2");
near "12": syntax error:
Surround the dates - in those cases in which they are column names - with double quotes or backticks.
INSERT INTO table1("12/30/2016") SELECT "12/30/2016" FROM table2
See also: http://www.sqlite.org/lang_keywords.html