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

How to delete duplicate rows?

0 Answers  


What is normalization and denormalization in sql server?

0 Answers  


What is a livelock?

0 Answers  


what is the difference between group and having give an example with query and sample output

7 Answers  


How to create a view with data from multiple tables?

0 Answers  






What is the default server name for sql server?

0 Answers  


What are different types of Keys? Please explain all the keys with a suitable example.

4 Answers  


What is the difference between NOROW and LOCKROW?

0 Answers   Accenture, Honeywell, Satyam,


Write a query to delete duplicate records in SQL SERVER

36 Answers   Infosys,


Differences between logshipping and mirroring

1 Answers   Microsoft, Syntel,


How to insert data with null values?

0 Answers  


Which system table contains information on constraints on all the tables created?

2 Answers  


Categories