• Thanks Dixie Flatline for the answer, It is almost what I am expecting, except we have value for null should be replaced by next value of buyPrice.

    Also, this data was derived from many tables that's why it do not have any sequence or index over it,

    Thanks again for great help 🙂