how do i eliminate a particular value when an id has more than one value in mysql -


I have a mysql query that returns more than one line for different id with different values ​​in this condition Need to eliminate id with some data.

Example

Enter image details here </ P> <p> I need to pass the A1 for all those IDs which have more than one name and others if only one value is A1 then I want </ strong> </ p > <Name> ID name value 1A1A1b1ab2c1cc3a1aa4a1aa4e1dd4b1b </ code> </ pre> <p> <Img src =

please

It probably flows Powerful is unattractive, but minimal work is done:

  Select ID, name, value from (select f * *, c count * from & lt; table & f; (selection * *, Count (*) 'count' from & lt; table & gt; group by id) c where f.id = c.id) c (where name = 'a1' and count = 1) or name! From the 'A1' group id  

you will find the 'first' row for the remaining (not random) for the id = 4, / code>


Comments