Aggregate Functions
Order by clause
Having Clause
Distinct Clause
Count
Max
Min
Avg
Sum
The default sort order is ascending, with
smallest values first.
To sort in reverse (descending) order, add
the DESC key...
SELECT ordernumber , itemsCount ,
sum(priceeach) AS total FROM orderdetails
GROUP BY ordernumber
order to remove the duplicate rows, we
use the DISTINCT operator in the SELECT
statement.
General Syntax
SELECT DISTINCT...
SELECT lastname FROM employees
ORDER BY lastname
SELECT DISTINCT lastname FROM employees
ORDER BY lastname
Mysql order by clause
Mysql order by clause
Mysql order by clause
Mysql order by clause
Mysql order by clause
Mysql order by clause
Mysql order by clause
Mysql order by clause
Mysql order by clause
Mysql order by clause
Mysql order by clause
Mysql order by clause
Mysql order by clause
Mysql order by clause
Mysql order by clause
Mysql order by clause
Upcoming SlideShare
Loading in...5
×

Mysql order by clause

134

Published on

Aggregate functions, Order by clause, Having Clause, Distinct Clause

Published in: Education, Spiritual, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
134
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Mysql order by clause

  1. 1. Aggregate Functions Order by clause Having Clause Distinct Clause
  2. 2. Count Max Min Avg Sum
  3. 3. The default sort order is ascending, with smallest values first. To sort in reverse (descending) order, add the DESC keyword to the name of the column you are sorting by:
  4. 4. SELECT ordernumber , itemsCount , sum(priceeach) AS total FROM orderdetails GROUP BY ordernumber
  5. 5. order to remove the duplicate rows, we use the DISTINCT operator in the SELECT statement. General Syntax SELECT DISTINCT columns FROM table_name WHERE where_conditions
  6. 6. SELECT lastname FROM employees ORDER BY lastname
  7. 7. SELECT DISTINCT lastname FROM employees ORDER BY lastname
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×