Howard
Howard

Reputation: 3758

MySQL how can I get the value of all rows with the same value once?

Table
--------
| col1 |
--------
|  A   |
--------
|  A   |
--------
|  A   |
--------
|  B   |
--------
|  B   |
--------
|  C   |
--------

How can I get values A, B, C?

Upvotes: 0

Views: 84

Answers (2)

user2741700
user2741700

Reputation: 901

you can use the following select:

select distinct(col1) from ...

Upvotes: 0

Ryan
Ryan

Reputation: 14649

Using a distinct query can accomplish your goal.

SELECT DISTINCT(col1) FROM `Table`;

Upvotes: 2

Related Questions