no. I did not. is this the only way? I tried what you proposed guys but none worked for me. let me get back to the main problem i have. I want this kind of SQL code to work [this time I'll use some better names for variables]
SELECT customer_ID, MAX(COUNT(*))
FROM ORDERS;
the above sql query has what i call MAX(COLUMN_HERE) problem :P
this is supposed to count the occurrences of customer_ID in ORDERS table and give the MAXIMUM of the occurrences. What I want to do, is to have the one or more customers that have equal occurrences so I could print their names and their telephones so we can give them a prize or something like it.
damn!
so if ORDERS has this data:
Code:
customer_ID product
1 Debian
2 ArchLinux
3 Gentoo
1 Fedora
3 Slackware
I somehow want to be able with an SQL query to find the names and telephone numbers [via another table] of the customers that have done the most orders. so I need their customer_ID. in this case I want to get customer 1 and customer 3 [both ordered 2 products which is the max here]
I really hope this time I made myself clear and that you can help me on this. thanks in advance