What is the difference between distinct clause and group by
clause?

Answers were Sorted based on User's Feedback



What is the difference between distinct clause and group by clause?..

Answer / swamy

Distinct Clause:
---------------
Distinct Clause Will Eliminate the Duplicate data or Rows
when u r selecting from table .So it Produce the Data or
Rows with out Duplication.Generally Distinct Clause will
be Placed on the Column of the Table.

Group Clause:
-------------
Group Clause will group or pack the rows or data based on
the Column(S).

Is This Answer Correct ?    24 Yes 5 No

What is the difference between distinct clause and group by clause?..

Answer / rkvenky

distinct suppress the duplicates of data in the select stmt.
where as group by combines the data which we willgive in
order.
2.group by used at the end of select stmt
distint used in select stmt to columns
3.
group by is function where distinct is keyword

Is This Answer Correct ?    8 Yes 13 No

Post New Answer

More SQL Server Interview Questions

Using the customer, and order table in northwind database, please write a query to produce xml?

1 Answers  


What is an execution plan? When would you use it? How would you view the execution plan?

1 Answers  


What do you understand by recursive stored procedure?

1 Answers  


What is a not null constraint?

1 Answers  


what authentication modes does sql server support? : Sql server database administration

1 Answers  


Write a program to fetch first 10 records from a file?

1 Answers   Amdocs,


Which feature in sql server 2008 has surprised you? You can name just one. : sql server database administration

1 Answers  


What is the difference between login and a user?

13 Answers   CTS, TCS,


If i am handling 150 servers then how to check the active jobs of all the servers?

0 Answers  


Explain Geography datatype in SQL Server

1 Answers   Infosys,


What are the differences between decimal and float in ms sql server?

1 Answers  


what type of indexes physically sort data?

3 Answers  


Categories