Try to search your question here, if you can't find : Ask Any Question Now ?

Sort by dynamic column

HomeCategory: stackoverflowSort by dynamic column
Avatarrupesh asked 5 months ago

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 current_price column?

1 Answers
Best Answer
Avatarnaveen answered 5 months ago
Your Answer

1 + 16 =

Popular Tags

WP Facebook Auto Publish Powered By :