我正在尝试创建一个具有 3 个状态的分类列:subA、subB 或两者都不是。
我正在使用 SqliteStudio 3.1.0、RHEL7.0。
我通过 Python/Pandas 将我的 csv 加载到 SQLITE 中。一切都按预期工作。
我在 GUI 中添加了约束:
"fullpath" TEXT Unique NOT NULL.
Run Code Online (Sandbox Code Playgroud)
我Sub
在 SqiteStudio 中添加了列并在数据表中仔细检查。
alter table data add column Sub text(100)
Run Code Online (Sandbox Code Playgroud)
这有效,没有给出错误。然后我尝试:
insert into data(Sub)
select fullpath, case
when fullpath like "%subA%" then "subA"
when fullpath like "%subB%" then "subB"
else "Neither" end
from data
Run Code Online (Sandbox Code Playgroud)
我收到这个我不明白的错误。
[18:35:45] Error while executing SQL query on database 'test': 2 values for 1 columns
Run Code Online (Sandbox Code Playgroud) sqlite ×1