colpivot icon indicating copy to clipboard operation
colpivot copied to clipboard

Mixed-case columns

Open jtara opened this issue 6 years ago • 0 comments

It would be good to include a note in the README about mixed-case columns.

The code does double-quote column names, so mixed-case columns can be used.

However, there are two cases where the user has to do the quoting themselves.

  • value_e
  • col_order

Example cross-tabulating grading results by lesson:

SELECT colpivot(
	'_test_pivoted', 
	'select * FROM n_correct_for_course_by_lesson_s(''ANON'')', 
	array['userCode'], 
	array['lessonCode'],
	'#."percentCorrect"',
	'MAX("lessonOrder")'   -- bizarre syntactical requirement
);
select * from _test_pivoted ORDER BY "userCode";

jtara avatar May 15 '18 04:05 jtara