mysql> SELECT DISTINCT columnname FROM tablename;
To show unique records in MySQL, you can use the DISTINCT
keyword in a SELECT
statement. Here’s an example:
sql
SELECT DISTINCT column1, column2, ...
FROM your_table;
Replace column1, column2, ...
with the columns for which you want to retrieve unique records, and your_table
with the actual name of your table. If you want to select all columns, you can use the asterisk *
:
sql
SELECT DISTINCT *
FROM your_table;
This query will return only the unique combinations of values in the specified columns or all columns.