I'm a strong believer in Hadley Wickham's "tidy data" and think this sort of transform shouldn't belong in the database! I presume you're going to use the tablefunc module, but then columns can appear and disappear and break other downstream code/queries. I'd therefore go with the longer and more explicit:
first to find out the possible values, with the LIMIT on in case of crazy data or schema misunderstandings. It also lets me do a quick check of the various _sales columns adding up to the global_sales column, again to make sure I understand the question and data.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I'm a strong believer in Hadley Wickham's "tidy data" and think this sort of transform shouldn't belong in the database! I presume you're going to use the
tablefunc
module, but then columns can appear and disappear and break other downstream code/queries. I'd therefore go with the longer and more explicit:which also lets me place the
Misc
genre at the end rather than awkwardly in the middle!I found it useful to run this:
first to find out the possible values, with the
LIMIT
on in case of crazy data or schema misunderstandings. It also lets me do a quick check of the various_sales
columns adding up to theglobal_sales
column, again to make sure I understand the question and data.