I want to extract rows from a table with distinct entries for a column and taking first/last values of other columns for each value of the unique column.
For example
q)t1:(c1:1 2 3 4; c2:sym?
cb
a`c)
q)t1
c1 c2
1 c
2 b
3 a
4 c
In this case, I want the following result -
c1 c2
2 b
3 a
4 c
I am doing this but its not working -
q)xcols[cols t1; select by c2 from t1]
'length
c1
c2
(+(,c2)!,
sym$a
bc)!+(,
c1)!,3 2 4
Not sure what this error means.