0

我在 sqlite 中有一个包含数据的数据库表。现在我尝试导出该表并以.csv格式导入 phpmyadmin 数据库。但有一些问题NOT NULL

Sqlite 端创建查询:

 CREATE TABLE StateDeathTax_V2 (Sequence Integer DEFAULT TEXT,Question,Alabama,Alaska,Arizona,Arkansas,California,Colorado,Connecticut,Delaware,"District of Columbia" TEXT DEFAULT NULL,Florida,Georgia,Hawaii,Idaho,Illinois,Indiana,Iowa,Kansas,Kentucky,Louisiana,Maine,Maryland,Massachusetts,Michigan,Minnesota,Mississippi,Missouri,Montana,Nebraska,Nevada,"New Hampshire" TEXT DEFAULT NULL,"New Jersey" TEXT DEFAULT NULL,"New Mexico" TEXT,"New York" TEXT DEFAULT NULL,"North Carolina" TEXT DEFAULT NULL,"North Dakota" TEXT DEFAULT NULL,Ohio,Oklahoma,Oregon,Pennsylvania,"Rhode Island" TEXT DEFAULT NULL,"South Carolina" TEXT,"South Dakota" TEXT DEFAULT NULL,Tennessee,Texas,Utah,Vermont,Virginia,Washington,"West Virginia" TEXT DEFAULT NULL,Wisconsin,Wyoming)

错误 :

SQL query:

CREATE TABLE IF NOT EXISTS `roster`.`TABLE 4` (`Sequence` int(1), `Question` varchar(56), `Alabama` varchar(66), `Alaska` varchar(68), `Arizona` varchar(196), `Arkansas` varchar(114), `California` varchar(78), `Colorado` varchar(83), `Connecticut` varchar(463), `Delaware` varchar(295), `District of Columbia` varchar(392), `Florida` varchar(92), `Georgia` varchar(66), `Hawaii` varchar(274), `Idaho` varchar(107), `Illinois` varchar(626), `Indiana` varchar(253), `Iowa` varchar(337), `Kansas` varchar(153), `Kentucky` varchar(216), `Louisiana` varchar(96), `Maine` varchar(1029), `Maryland` varchar(358), `Massachusetts` varchar(867), `Michigan` varchar(76), `Minnesota` varchar(470), `Mississippi` varchar(64), `Missouri` varchar(77), `Montana` varchar(79), `Nebraska` varchar(151), `Nevada` varchar(79), `New Hampshire` varchar(69), `New Jersey` varchar(775), `New Mexico` varchar(17), `New York` varchar(747), `North Carolina` varchar(73), `North Dakota` varchar(1366), `Ohio` varchar(509), `Okla[...]

MySQL said: Documentation
#1060 - Duplicate column name 'NULL' 
4

1 回答 1

0
  1. 确认您在 sqlite 中创建的表有数据并且看起来不错。
  2. 在 sqlite 中,执行以下操作:

    sqlite> .header on sqlite> .mode csv sqlite> .output data.csv sqlite> select * from StateDeathTax_V2 ; sqlite> .quit

  3. 通过检查文件确认数据已正确导出data.csv

  4. 导入,见答案:https ://stackoverflow.com/questions/9734486/importing-a-csv-into-phpmyadmin
于 2017-02-12T23:36:56.010 回答