SQLite version 3.7.3
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> ATTACH DATABASE 'test.db' AS 12;
sqlite> SELECT * FROM ids;
1|hi
2|hilo
3|hiloa
4|hiloas
sqlite> .databases
seq name file
--- --------------- ----------------------------------------------------------
0 main
2 12 C:\test.db
sqlite> SELECT * FROM 12.ids;
Error: unrecognized token: "12.ids"
为什么会出错?数据显然在那里。
答案 0 :(得分:3)
SELECT * FROM `12`.ids;
如果您要使用奇数名称(例如全数字名称),您最好正确地逃避它们。