Skip to content
Advertisement

Including only one row in sql [closed]

What I’m trying to do is take these records that looks like this:

and change it to look like this:

Including the name that has enrollmented in 15th of the month, Peter enrolled in the 15th of July while Tony did not.

The idea is to pick only one name in July.

I am having difficult time making this work. Any help would be appreciated.

Thanks

Advertisement

Answer

You seem to want to filter rows where startdate is earlier than the 15th of the enrollment month:

If enrollmentmonth is always the first of a month, we can dispense trunc():

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement