will give you the ID of field 'a.ID'. If there is a field in table b with the same name you will always get only one result (most likely the one from the first table, in our example this would be 'players'). The only solution is to rename the field directly in the table or to use an alias in the query: