What is difference between ORDER BY and GROUP BY in SQL??


Groupby : It is a way to sub-total your results,or perform
some other ‘aggregate’ functions on them.
e.g : select sum(salary)from salary Groupby employee name.

Orderby : It is a simply a way to sort your results. it display result in assending or dessending order.
e.g : select * from customer where column name=”value” orderby column name.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s