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

Sort by dynamic column

HomeCategory: stackoverflowSort by dynamic column
rupesh asked 1 week 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
naveen answered 1 week ago
Your Answer

18 + 4 =

Popular Tags

WP Facebook Auto Publish Powered By : XYZScripts.com