Login
Remember
Register
Ask a Question
How MySQL Optimizes DISTINCT?
0
votes
asked
Jan 14, 2024
in
Sql
by
AdilsonLima
How MySQL Optimizes DISTINCT?
mysql-interview-questions-answers
Please
log in
or
register
to answer this question.
1
Answer
0
votes
answered
Jan 14, 2024
by
AdilsonLima
DISTINCT is converted to a GROUP BY on all columns and it will be combined with ORDER BY clause.
SELECT DISTINCT t1.a FROM t1,t2 where t1.a=t2.a;
...