Dynamic hotel rates | Sololearn: Learn to code for FREE!

+7

Dynamic hotel rates

I have table of rates with columns [check-in, check-out, price] 2021-05-12 2021-05-18 30$ 2021-05-19 2021-05-23 35$ now if clients search for date range 2021-05-15 to 2021-05-22 rate must be calculated from two rows 3 days from first row and 4 from second need the query for dynamic rates changes

5/12/2021 12:25:03 PM

Shahghasi Adil 👑 🇦🇫

7 Answers

New Answer

+3

SELECT TOP number|percent column_name(s) FROM table_name WHERE condition;

+3

S-Adil 👑 show me the table

0

JOY it's not about that you think clients search in date range where it exists between two rows

-1

if I search for date range 2021-05-12 to 2021-05-22 this row rate isn't exists it must calculated from both rows 30$ 35$

-1

rates table check-in check-out price 2021-05-12 2021-05-18 30$ 2021-05-19 2021-05-23 35$

-1

JOY check-in and check-out is date range from - to