For example:
There are have tabel_1 in the database :
C1 C2
1 2
1 2
1 3
Execute sql cmd:
Select distinct C1 from table_1
result: C1
1
Execute sql cmd:
Select distinct C1,C2 from table_1
result: C1 C2
1 2
1 3
How the database execute this sql cmd? We can understand below:
Frist, Select C1 from table_1 ***no distinct
Second, Campare the Data, if same, delete,only exist diffience record.