I have an
items table in PostgreSQL with 4 columns: start_price, end_price, start_date, duration.
I’d like to support queries to return items ordered by current_price, which is calculated by the formular as below
current_price = start_price + (end_price - start_price) * (current_time - start_date) / duration
How to design such table and the