I I have a simple table in KDB and would like to know if there's an elegant way to update the first N rows and set all the values to 0n without explicitly specifying each of the column names because I do not know how many columns I have a-priori.
tbl:([] c1:1+til 10; c2:1+til 10; c3:1+til 10)
I can select the top N rows using select [10] from t
....but I'm not very sure how to update the top N row.
Any help is much appreciated.
edit
Saw the reply from @Jorge Sawyer but didn't really understand what the code was doing enough to modify it myself. Hence require help to do the same for the following date-keyed table:
tbl2:([date:2021.01.01+til 10] c1:1.1+til 10; c2:1.1+til 10; c3:1.1+til 10)