In performance wise distinct is good or group by is good?
eg:select name from emp group by name;
select distinct name from emp;
Answer Posted / ghorban adabi
I have test DISTINCT and GROUP BY query on a table in my
site db with 7800 record. the results that turned GROUP BY
was faster than DISTINCT!!!
GROUP BY result -> Query took 0.0094 sec
DISTINCT result -> Query took 0.0133 sec
Is This Answer Correct ? | 5 Yes | 0 No |
Post New Answer View All Answers
What are the types of subquery?
What is the cartesian product of the table?
How do you make a trace?
Characterize join and name diverse sorts of joins?
1.what are diff types of joins , and explain diff between cross join and full outer join 2.diff types of views 3. Diff types of index 4. What is diff b/w stores procedure and function procedure 5.diff between double and int in SQL 6.diff between char and varchar in SQL. 7.Oracle or SQL whice you will preferred and why.
After removing a table from database, what other related objects have to be dropped explicitly?
How to use subqueries with the in operators in ms sql server?
Do you know what is recursion? Is it possible for a stored procedure to call itself or recursive stored procedure?
Hi all, can any one please tell me the difference between sql server 2008 and orace 9i
Explain the types of indexes.
What are dml triggers and types of dml triggers?
Tell me what is difference between view and materialized view?
How do I find the sql server version?
What is a trigger and its types?
What are the different types of stored procedures?