1.

What is the difference between the order by and group by clause when used along with the select statement. Explain with an example.

Answer»

The order by clause is used to show the contents of a table/relation in a sorted manner with respect to the column mentioned after the order by clause. The contents of the column can be arranged in ascending or descending order.

The group by clause is used to group rows in a given column and then apply an aggregate function eg max(), min() etc on the entire group.



Discussion

No Comment Found

Related InterviewSolutions