How do I select all columns in q?

By listing nothing at all in the select clause:

q)table: ([] x: 5 10 15 20; y: 1 2 3 4)
q)table
x  y
----
5  1
10 2
15 3
20 4
q)select from table where x > 10
x  y
----
15 3
20 4
q)

or SQL via “s)”:

q)s)select * from table where x > 10
x y
—-
15 3
20 4
q)

See also: $QHOME/s.k

Share:

2 Comments

  1. fzh
    October 1, 2012 / 1:19 pm

    thanks for the great FAQ articles. If a table has hundreds of columns, is there a quick way to select all but a few columns (like select all excep X1, X2, X3?) Thanks

  2. kdbfaq
    October 7, 2012 / 10:15 pm

    “delete X1, X2, X3 from table” returns a copy of table, minus the named columns. Thanks for your question!

Leave a Reply