I think the built in selector is making your life harder because the information that contains is 1,2,3,4,5. You then need to map 3 to the ID of your 3rd row.
So, if you check row 1 and 3, on submit, the row selector will have two rows, one with value of 1 and with with value of 3.
I would remove the selector, use and ID column that I can change to be Simple Checkbox (or whatever value you can use to uniquely identify it). Or add your own apex_item.checkbox(n, ID) to your SQL.
Then your loop on apex_application.g_f01.count (if that's the checkbox column) will only contain the elements checked and their values will be the ID that are checked.
All that said, here's a useful example from Denes Kubicek
Hope this makes sense
Message was edited by: jrimblas Added link to Denes example page