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

What is the difference between GROUP BY and ORDER
(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:

What is the difference between GROUP BY and ORDER

What is the difference between GROUP BY and ORDER 1 year, 4 months ago #435

  • isaac
  • OFFLINE
  • Senior Boarder
  • Posts: 64
  • Karma: 0
What is the difference between GROUP BY and ORDER BY in MySQL?

Re: What is the difference between GROUP BY and ORDER 1 year, 4 months ago #473

  • patrica
  • OFFLINE
  • Junior Boarder
  • Posts: 28
  • Karma: 0
ORDER BY [col1],[col2],…,[coln];
Tells DBMS according to what columns it should sort the result. If two rows will have the same value in col1 it will try to sort them according to col2 and so on.

GROUP BY [col1],[col2],…,[coln];
Tells DBMS to group results with same value of column col1. You can use COUNT(col1), SUM(col1), AVG(col1) with it, if you want to count all items in group, sum all values or view average.
  • Page:
  • 1
Time to create page: 1.24 seconds
OSV Newsletter


Receive HTML?

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