• I am somewhat troubled. You're being paid to work for an airline, but you're really lost as to how to do the job you're being paid to do ?

    Everything you're saying seems to me to point towards the database not really being suited to the task at hand. This questions has become a confusing set of edge cases. I'd suggest you need to either fix the database design, or if it can't be changed, work out how to differentiate what you want. It looks to me like a starting point might be to group by departure date, in order to not end up grouping the return flights with the flights going out. Sometimes people do have a connection the next day, but your data base does not have arrival times, or even departure times, these are ways in which it is fundamentally broken.