Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MYSQL select only 1 from 5 same values

I want to get one value out of 5 which are the same, lets say 5 records have the same value in some column.

How do I only get one out of them and not 5 ?

like image 308
Osa Avatar asked Sep 05 '25 03:09

Osa


1 Answers

Add DISTINCT to your query:

SELECT DISTINCT field FROM table;
like image 146
favoretti Avatar answered Sep 07 '25 16:09

favoretti