If your application is using Endeca Analytics, you can customize the Results Table to display table-based results for Analytics statements.
return test as select avg("P_Price") as avgprice, avg("P_Score") as avgscore group by "Vintage"
will create three columns: avgprice, avgscore, and Vintage.
To configure the Results Table for Analytics statements:
To revert to a non-Analytics Results Table, uncheck the Use analytics statement checkbox. Doing so will present you with a Disable Analytics Statement button, which you can click to revert to the standard Results Table grid.