•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 391,696 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,174 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MySQL advertiser:
Views: 870 | Replies: 0
![]() |
•
•
Join Date: Jul 2006
Posts: 7
Reputation:
Rep Power: 0
Solved Threads: 0
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?
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?
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb MySQL Marketplace
Similar Threads
- C command-line I/O question (C++)
- datagrid grouping question (VB.NET)
- (another) big O question (Computer Science and Software Design)
- Completely new to C++ and have question about using char (C++)
- question on cooling (Cases, Fans and Power Supplies)
- Context-sensitive grammar question :( (Computer Science and Software Design)
- Welcome PC Mod Kingdom peeps! (Geeks' Lounge)
- Laptop LCD built into a car? (Monitors, Displays and Video Cards)
- Changing Network Configuration (*nix Software)
Other Threads in the MySQL Forum
- Previous Thread: powerbuilder+mysql
- Next Thread: Upload Database


Linear Mode