SQL*Plus (MOSC)

MOSC Banner

SQL Query to summarize data based on dates

edited Oct 11, 2015 8:22AM in SQL*Plus (MOSC) 4 commentsAnswered

Hi,

I have a table which has following data

Booking number     Booking amount     Check-in Date     Check-out Date

1                              100                     01-AUG-2015     03-AUG-2015

2                              250                     30-AUG-2015     04-SEP-2015

3                              300                     01-SEP-2015     02-SEP-2015

I want this data as follows

Month                    Booking Amount

AUG-15                         200

SEP-15                         450

Here for booking number 2, we are splitting booking amount evenly between all the dates. 2 days in august and 3 days (4th Sep is not counted as it is a check-out date) in September gets $50 each.

Can someone please help me in displaying the data is above format?

Thanks.

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center