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

What is the difference between varchar and nvarchar?

0 Answers  


Where is localdb stored?

0 Answers  


what is the difference between them (ethernet networks and token ring networks)? : Sql server database administration

0 Answers  


How to truncate a table first before running a package?

1 Answers  


How do you find value of first column before inserting value into the second column in the same table for checking that second column must have different value than first column.

2 Answers   L&T,






Define left outer join?

0 Answers  


What do you mean by tablesample?

0 Answers  


How you can change a cross join into an inner join?

0 Answers  


What is transaction ? Give me one example.

11 Answers   Melstar, Wipro,


How is table type constraint applied to a table?

0 Answers  


What is difference between commit and rollback when used in transactions?

0 Answers  


Can foreign key be deleted?

0 Answers  


Categories