Home
Recent Q&A
Java
Cloud
JavaScript
Python
SQL
PHP
HTML
C++
Data Science
DBMS
Devops
Hadoop
Machine Learning
Azure
Blockchain
Devops
Ask a Question
How MySQL Optimizes DISTINCT?
Home
Sql
How MySQL Optimizes DISTINCT?
asked
Jan 14
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
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;
...