0

I'm working on a sales dataset of video games recorded for 40 years. Following is a sample of the dataset. Sample of the complete dataset

How do I find average of global_sales before 2010 and after 2010 into columns by the same names?

These are the codes I've tried but I don't know how to get it together in the same view.

SELECT ROUND(AVG(global_sales), 3) AS pre_2010 
FROM vgsales 
WHERE vg_year < '2010';

SELECT ROUND(AVG(global_sales), 3) AS post_2010 
FROM vgsales 
WHERE vg_year > '2010';

Output for the first query Output for the second query

Any help would be appreciated.

Mark Rotteveel
  • 90,369
  • 161
  • 124
  • 175

0 Answers0