I have the following table:
I want to calculate the median mileage per car in one query (SQLite). How do I do that?
Here's the closest I've come:
SELECT Car, Mileage, ROW_NUMBER() OVER (PARTITION BY Car ORDER BY Mileage) RowNum FROM car_table ORDER BY Car, Mileage;
My expected output is:
Car | Median Mileage
