How to eliminate a particular value from a mysql query when it has more than one value and leave as it is when it has only one value -


I have a mysql query that returns more than one line for different id with different values ​​in this condition ID needs to be eliminated with specific data

example

  id's name value 1a1aa1b1ab2c1cc3a1aa4 A1AA 4E1Ad4B1Ab  

I have to eliminate the A1 for all those IDs which have more than one name and others if only one value A1 is Programmed I should be able to display it. / P>

should look for the result

  ID name value 1B1 AB2C1CC3A1AA4E1Ad ----A random value of two  

Help me with a solution for this.

I'm not sure that I understand a lot of the device - but this is the right result for that particular data set The set provides ...

  SELECT x. * From my_table x (SELECT id, MAX (name), max_name, my_table GROUP by id) y on y.id = x.id and y.max_name = x.name;  

Comments