Closed ramannanda9 closed 7 years ago
For future reference for other users: the issue isn't the avgs
, nor the grouping, but rather that writing to csv (or any file for that matter) from aquery only is possible with normalized tables (i.e. no nested arrays)
Thanks Jose,
Here is the query for future references.
with grouped_averages(stock_symbol,avg_price) as (select stocksymbol, avgs(10,price) as avg_price from trades assuming asc time where stocksymbol=1
group by stocksymbol)
select * from flatten(grouped_averages)
INTO OUTFILE "op.csv"
FIELDS TERMINATED BY ","
I am using the latest build.
The query is mentioned below. It works fine when group by stocksymbol is not used, but that is not the intended use.
And the message that is printed on q console is as follows.
My KDB version is