开发者

Skip Duplicate entries in row (MySQL)

开发者 https://www.devze.com 2023-01-24 12:31 出处:网络
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 un

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 ....
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号