On Fri, Nov 18, 2005 at 05:43:01PM +0100, Noel Frankinet wrote:
> >My current workaround is to have my function return a comma separated
> >list of values ("10,9,8"), parse this string in my application, and
> >generate a new query, but ideally I'd like to do this in one step.
>
> why not a vector of values ?

A vector of values (I presume you mean returning a BLOB that is
actually an array of values?) would be great if there was any way to
use these values as part of a JOIN:

SELECT * FROM other_table JOIN (SELECT max_n(col, n) FROM test);

Is there any existing syntax that would allow this?  Or would I still
need a new token (EXPLODE) that would convert from the vector to the
component values at the VDBE level?  

Also, for my real application I would actually need a vector of rows
(ie, a table), since I want to be able to return not just the value of
max but some identifying id.  Here's closer to my actual query:

SELECT matrix_match(base.uid, base.vector, test.uid, test.vector) 
  FROM vectors AS test, (SELECT uid, vector FROM vectors) AS base
  GROUP BY base.uid;
1|123,456,789
2|234,567,890
...

--nate

Reply via email to