On the reservation table, there are columns such as SYSDATE, rental fee, rental date, return date, payment amount, and final payment amount. When the rental fee is 30,000 won per day, When I rented it for five days, Can I know the query that asks for 150,000 won for the final payment price?
Reservation date = current time
Rental Date = DATE EX// 2020-04-22
Return Date = DATE EX// 2020-04-27 : Borrow 5 days
Rental fee: KRW 30,000
Final payment amount: KRW 150,000
I want to be like this
oracle sql
SELECT EXTRACT(DAY FROM B) - EXTRACT(DAY FROM A) FROM DUAL
Write the EXTRACT function.
© 2024 OneMinuteCode. All rights reserved.