Check duplicate mysql string

I have a mysql table containing field_one , field_two , field_three

I want to check if field_one contains a duplicate value (for example, if it was unique).

How to do this in mysql?

thanks

+4
source share
2 answers

This will show you the values ​​for field_one that occur more than once:

 select field_one, count(*) as Count from MyTable group by field_one having count(*) > 1 
+16
source
 select field_one from tblName where field_one like %'@field_one'% 

or

 select field_one from tblName where field_one = @filed_one 
+1
source

All Articles