I have a 开发者_如何学编程C# Windows Forms application that extracts rows from a particular column. But, many of the rows have duplicate entries (which is fine), however, I only want to display all unique row values of this one column.
Is there a MySQL query that you know about that can do this?
Thanks! :)
select distinct (`column`)...
or
select ... group by `column`
You have to use the DISTINCT keyword. It ignores duplicates.
SELECT
DISTINCT ColumnName
FROM
TableName
WHERE
<condition>
select distinct(column_name) from your_table
Use the DISTINCT keyword in the SELECT statement.
SELECT DISTINCT column FROM TABLE WHERE ....
精彩评论