1

I have a table with a bunch of columns of various types. I need to delete all columns of a particular type, but I can't figure out how to do this.

I would like something like this:

delete from quotes where type = 11

But this doesn't work. Is there a way to do this? I was also able to list the relevant columns with the command

select c from meta quotes where type="s"

But this gives me a one column table with the column headings and I don't know where to go from there.

1 Answers1

2

Could use a functional delete (!), or a take (#) or a 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
terrylynch
  • 11,844
  • 13
  • 21