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
Post a Comment