« I have a very big text file. Can I read a text file in chunks? | Main | How do I read in a text file? »

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

PrintView Printer Friendly Version

EmailEmail Article to Friend

Reader Comments (2)

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

October 1, 2012 | Unregistered Commenterfzh

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

October 7, 2012 | Registered Commenterkdbfaq

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
All HTML will be escaped. Textile formatting is allowed.