I have a table that has some rows that are populated by a date and some rows that have the date but the rest of the fields are null. Looking for the most efficient sql scripting for filling down missing values for make and sale price, I do not want the other null values to be changed(note price changes). I want the same make and price for the rows that follow that contain null values.
Example of what table looks like:
Sale_Dates | Make | Sale_Price | Year | Color
2015-01-01 | Ford | 20000.00 |2012 | Blue
2015-01-02 | NULL | NULL |NULL | NULL
2015-01-03 | NULL | NULL |NULL | NULL
2015-01-04 | Ford | 30000.00 |NULL | NULL
2015-01-05 | NULL | NULL |NULL | NULL
Example of expected output:
Sale_Dates | Make | Sale_Price | Year | Color
2015-01-01 | Ford | 20000.00 |2012 | Blue
2015-01-02 | Ford | 20000.00 |NULL | NULL
2015-01-03 | Ford | 20000.00 |NULL | NULL
2015-01-04 | Ford | 30000.00 |NULL | NULL
2015-01-05 | Ford | 30000.00 |NULL | NULL