I have a table where more than one rows with same ttid
. I would like to get ttid
rows based on status column is done
.
tb tbid ttid status
-----------------------------
216 6 5 done
216 6 5 running
216 7 5 preparing
217 11 10 done
217 11 10 done
218 12 11 done
218 12 11 running
212 15 14 done
212 15 14 running
220 17 15 done
220 17 15 done
I wanted to have the following rows only:
tb tbid ttid status
--------------------------------
217 11 10 done
220 17 15 done
I have tried the following query but it gives wrong info for tb: 216
, because two different tbid
.
select tb,tbid,tbid,status FROM tt
status in ('done')
Could you please help how to get the expected results.