Is there a way to generate a query that producesa pivot table, much like
MS's Jet does with TRANSFORM.... PIVOT BY? 

I did a google search, and the best I saw was to build up a bunch of
case statements for each pivot value. But that would only work if you
know ahead of time how many there are going to be and what values will
be in there.

I seem to recall seeing something a few years back where you create a
temp table with all the pivot values, and by doing a cross product of
the original data with the temp table, then filtering it out, you'd get
the results you want, but I can't find that anymore.

So is there a way to do it directly in SQLite in its supported SQL?

Thanks,
David

Reply via email to