I have a table that is similar to:
cycle | id | name
------|-------|------
0 | 0012 | bob
s | 0012 | bob
1 | 0012 | bob
0 | 6208 | sally
1 | 6208 | sally
0 | 3276 | jane
s | 3276 | jane
1 | 3276 | jane
0 | 8736 | harry
s | 8736 | harry
I need a query that will result in:
cycle | id | name
------|-------|------
s | 0012 | bob
0 | 6208 | sally
s | 3276 | jane
s | 8736 | harry
So only return rows that have a 'cycle' value of "s", unless there is no value of "s" for a particular 'id' in which case it should return the row with the 'cycle' value of "0".