Open Source Tutorials - Open Source Training
Open source training & tutorials from experienced, passionate people
chrome icon firefox icon ie icon opera icon safari icon Sings in these Browsers
A- A A+

By A Web Design

Welcome, Guest
Username Password: Remember me

GROUP BY clause and Distinct Query
(1 viewing) (1) Guest
All your queries regarding
MySQL Installation,
Learning MySQL DBA,
and tonnes more... will be solved in this forum
  • Page:
  • 1
TOPIC:

GROUP BY clause and Distinct Query

GROUP BY clause and Distinct Query 1 year, 4 months ago #458

  • abott
  • OFFLINE
  • Junior Boarder
  • Posts: 25
  • Karma: 0
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: GROUP BY clause and Distinct Query 1 year, 4 months ago #468

  • isaac
  • OFFLINE
  • Senior Boarder
  • Posts: 64
  • Karma: 0
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.
  • Page:
  • 1
Time to create page: 1.19 seconds
OSV Newsletter


Receive HTML?

NOTE: To prevent subscription to the OSV newsletter, uncheck the checkbox above.
Guest Blog for OSV
Free Ebook Download