Vote4WillFree 0 Newbie Poster

I have a table with three columns that I want to group. The columns are driver, passenger and date.

Basically what I want is something like...

SELECT COUNT(*) FROM TABLE GROUP BY driver,passenger,date;

However what can happen is that the driver and passenger can be the opposite on the same date. For example on the 10th of July there are two entries. The first had the driver as Tom and passenger as Jerry. The second entry had the driver as Jerry and passenger as Tom.

So is there a way that I can group my table so that it groups it either way?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.