PHP Questions Home | Register | Login
Categories
Arrays
Files
Forms
Creating PDFs
PHP Errors
Functions
Images
MySQL
Numbers
Others
Strings
Website
Unanswered

PHP Forums
Forums Index
MySQL Forum
PHP Forum
Flash/Actionscript
Javascript
Web design

More PHP
PHP Functions
Top Questions
Ask a Question
PHP Interview Questions
PHP Jobs
Ecommerce
IT Questions
Business Websites

Sponsors

sponsor ad
My Salary
PHP Developer Salary
Advertise Here

PHP Questions Forums : mySQL Questions and Answers

Jump to Last Post

Help with grouping queries in mySQL

By: Sallyjones [21-February-10 9:33AM]
12 posts
picture

Can someone tell me where the GROUP BY clause gets added to in the mysql query.

I am never sure with this one where it goes whether it is before or after an order by clause?

Also what is the DISTINCT query, is this the same or something different?

Re : Help with grouping queries in mySQL


Timjohns [26-February-10 8:40AM]
25 posts
picture

Hi there

The grouping can be quite tricky, particularly as the queries get more and more complicated.

Basically it should go before the order by clause. The distinct query returns unique values rather than grouping values.

Re : Help with grouping queries in mySQL


Sallyjones [3-March-10 4:24PM]
12 posts
picture

Ok thanks for that... in the meantime I managed to get someone to explain to me the various different types of clause and so on with mysql and when to use GROUP BY and how it relates to other ways of collating data.

I also found about the HAVING clause rather than WHERE too so that was also interesting as I didn't even know there was a HAVING clause!

Previous: Update Not Working For Larger Text Input
Next: MySQL And The HAVING Clause



Custom Search