For example, if a table is like this, the ID is the primary key and the table is auto-incrementing:
Column name: Id Columna columnb columnc
Column value: 1 A asdfd afdsf
2 B sdfafsd 080dfs
3 A dfsafja08 90879.
4 C fds934 fsdaf
5 B safsfsd fd86fsdaf
The query results after the SQL statement is executed are as follows:
Column name: Id Columna columnb columnc
Column value: 1 A asdfd afdsf
2 B sdfafsd 080dfs
That is to say, we need to find a record where Columna has duplicate values and only one record is repeated. For example, if Columna is A, there are two records, the retrieved Record ID = 1 or ID = 3. The same applies to colunma = B.
The following is an SQL statement:
Select * from table where ID in (select Min (ID) from Table group by Columna)
The above statement was put forward by me, and then the "Guangdong. Net" QQ Group discussed it collectively. Finally, it was written by Jerry, and he did not dare to seek help.