$ sqlite3 test.sql# T l4 {/ P& q
SQLite version 3.6.12 3 J+ p* e* s' D; z4 Z/ n Enter “.help” for instructions3 P" O. m5 {" T }: O8 S
Enter SQL statements terminated with a “;”: y( a2 r3 B; \4 v, E( x
sqlite> create table test (id integer,author_id integer,title varchar(128),name text); 0 B6 Z" u. v" p) U6 j, ` sqlite> .separator “;” 4 j& _! m, P" C. t4 B sqlite> .import sqlite.csv test0 a6 w( ?$ j$ L1 N& b8 y
sqlite.csv line 3: expected 4 columns of data but found 16 E3 J, w( Q" K8 C
sqlite> .separator ‘;’ . p: O4 D; r# V1 o$ Y( ~ sqlite> .import sqlite.csv test 6 Q: L6 W) _8 J1 w9 J sqlite.csv line 3: expected 4 columns of data but found 1 * c, e& w- x9 c0 g sqlite> 3 m h! V. @9 X" b {我试着使用导入csv表;作为sqlite但是找不到四列分隔符。sql导出到csv,并选择了在第一行放入第一行。我能在这里丢失一些东西吗?! r) ]$ N# o) g- W5 R8 z* ^
CSV的前5行* C9 a# f2 u1 y9 H& L6 y5 P
id;"author_id";"title";"poem" 1;"92";"A Letter From Italy";"Salve magna parens frugum Saturnia tellus Magna virm! tibi res antiqu laudis et artis Aggredior sanctos ausus recludere fontes. Virg. Geor. 2. 2 |1 {' P' I5 X! m: k; D" M2 U8 V 解决方案: / o, Y/ {0 Y0 `5 n z' ] 不能使用主键导入表,必须先导入临时表。% p* `" ]1 A% C" L
看看这个问题的答案