| | |
Grouping question
Please support our MySQL advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jul 2006
Posts: 7
Reputation:
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?
![]() |
Similar Threads
- C command-line I/O question (C++)
- datagrid grouping question (VB.NET)
- (another) big O question (Computer Science)
- 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)
- 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
| Thread Tools | Search this Thread |
1 agplv3 alfresco amazon api artisticlicense aws bizspark camparingtocolumns changingprices cmg communityjournalism contentmanagement contractors copyright count crm data database design developer development distinct drupal dui ec2 email enter enterprise error facebook form foss gartner gnu government gpl greenit groklaw groupware hiring hyperic images innerjoins insert ip joebrockmeier join journalism keyword kickfire laptop legal license licensing linux maintenance mariadb matchingcolumns metron micromanage microsoft microsoftexchange mindtouch montywidenius mozilla multiple music mysql mysqlcolumnupdating mysqldatetimeordermax() mysqlindex mysqlinternalqueries mysqlquery mysqlsearch news open-xchange opendatabasealliance opengovernment opensource operand oracle penelope php priceupdating query referencedesign reorderingcolumns saas select sharepoint simpledb sourcecode spotify sql sugarcrm syntax techsupport thunderbird virtualization





