Mysql do not select duplicated values, conditional -


i looking way run simple select statement. have table has 3 columns: id, title , active, active column represents boolean value.

1. foo false 2. foo false 3. foo true 4. bar false 5. bar false 6. aaa false 7. ccc false 8. ccc true 

i want return following:

4. bar false 5. aaa false 

this show titles have single active value (this looking for, correct?), , min id title.

select min(id) id, title, active    yourtable  group title  having min(active) = max(active) 

Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -