V0.50.10 dont support pivot table when use mysql sql query

v0.50.10 dont support pivot table when use mysql sql query,
but it support when use question builder

Hey borui

You're hitting one of the limitations of pivot tables.

Pivot tables only work with relational databases that support joins and expressions, so you won’t be able to use them with databases like MongoDB. They also only work with questions composed with the query builder. The workaround here is that if you must use SQL to compose a question, you can save that question, then use its results as the starting point for a query builder question in order to build a question. The trick here is to do your aggregation and grouping in the GUI question. That is, use the SQL question to grab the raw data you want to work with (maybe create a model), then start a new GUI question to filter, summarize, and group that data.

Thanks