What is meant by SORTING and GROUPING

Showing Answers 1 - 5 of 5 Answers

SURESH

  • Aug 24th, 2005
 

For sorting we use order by clause in select statement. This is used to sort data in ascending order or descending order. 
To group data based on perticulr column we use groupby clause. 
Both are used to get distinct values.

  Was this answer useful?  Yes

ravi wadalkar

  • Jan 2nd, 2006
 

sorry to say,

sorting will not give distinct values, but will just sort the data depending on asceding[default]or desc.

group by will group the data depending upon the distinct values with in a column by which we are grouping

  Was this answer useful?  Yes

sorting mean puting the value in a particular order , could by alhphabatic

gouping mean making a group of same type of values and displaying a single row for that group

example

select deptno, sum(sal)  from emp group by deptno order by 1;

first the query will select all deptno and sal , then will make group of all deptno and make sum of the sal of that group, then it will put the value in order of deptno

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions