【发布时间】:2016-04-01 13:45:52
【问题描述】:
我有一张表,里面有一堆不同类型的列。我需要删除特定类型的所有列,但我不知道该怎么做。
我想要这样的东西:
delete from quotes where type = 11
但这不起作用。有没有办法做到这一点?我还可以使用命令列出相关列
select c from meta quotes where type="s"
但这给了我一个包含列标题的单列表,我不知道从那里去哪里。
【问题讨论】:
我有一张表,里面有一堆不同类型的列。我需要删除特定类型的所有列,但我不知道该怎么做。
我想要这样的东西:
delete from quotes where type = 11
但这不起作用。有没有办法做到这一点?我还可以使用命令列出相关列
select c from meta quotes where type="s"
但这给了我一个包含列标题的单列表,我不知道从那里去哪里。
【问题讨论】:
可以使用功能删除 (!),或 take (#) 或 drop (_)
q)t:([] col1:`a`b`c;col2:1 2 3;col3:`x`y`z;col4:"foo")
q)![t;();0b;exec c from meta[t] where t="s"]
col2 col4
---------
1 f
2 o
3 o
q)(exec c from meta[t] where t<>"s")#t
col2 col4
---------
1 f
2 o
3 o
q)(exec c from meta[t] where t="s") _ t
col2 col4
---------
1 f
2 o
3 o
【讨论】: