I read some suggestions but couldn't figure out how to make the query that is generated and shown by views - valid in MySQL. There are some variables closed in {} and also I think there are some tables in the query which don't exist in the DB. I'm trying to extract a quite complicated query here it is.
SELECT field_data_field_punch_status.field_punch_status_value AS field_data_field_punch_status_field_punch_status_value, users.name AS users_name, users.uid AS uid_1, field_data_field_punch_start.field_punch_start_value AS field_data_field_punch_start_field_punch_start_value, field_data_field_team.field_team_tid AS field_data_field_team_field_team_tid, users.access AS users_access, MIN(users.uid) AS uid, 'user' AS field_data_field_punch_status_user_entity_type, 'user' AS field_data_field_punch_start_user_entity_type, MIN(node_users.nid) AS node_users_nid, 'node' AS field_data_field_punch_end_node_entity_type, MAX(node_users__field_data_field_punch_end.field_punch_end_value) AS node_users__field_data_field_punch_end_field_punch_end_value, 'user' AS field_data_field_team_user_entity_type
FROM
{users} users
LEFT JOIN {field_data_field_team} field_data_field_team ON users.uid = field_data_field_team.entity_id AND (field_data_field_team.entity_type = 'user' AND field_data_field_team.deleted = '0')
INNER JOIN {taxonomy_term_data} taxonomy_term_data_field_data_field_team ON field_data_field_team.field_team_tid = taxonomy_term_data_field_data_field_team.tid
LEFT JOIN {node} node_users ON users.uid = node_users.uid
INNER JOIN {users_roles} users_roles ON users.uid = users_roles.uid
LEFT JOIN {field_data_field_punch_status} field_data_field_punch_status ON users.uid = field_data_field_punch_status.entity_id AND (field_data_field_punch_status.entity_type = 'user' AND field_data_field_punch_status.deleted = '0')
LEFT JOIN {field_data_field_punch_start} field_data_field_punch_start ON users.uid = field_data_field_punch_start.entity_id AND (field_data_field_punch_start.entity_type = 'user' AND field_data_field_punch_start.deleted = '0')
LEFT JOIN {field_data_field_punch_end} node_users__field_data_field_punch_end ON node_users.nid = node_users__field_data_field_punch_end.entity_id AND (node_users__field_data_field_punch_end.entity_type = 'node' AND node_users__field_data_field_punch_end.deleted = '0')
WHERE (( (field_data_field_team.field_team_tid IN('0', '10', '11', '22', '12', '2', '21', '3', '13', '4', '14', '5', '15', '6', '16', '7', '17', '18', '20', '19') ) AND (users_roles.rid IN ('4', '5')) ))
GROUP BY field_data_field_punch_status_field_punch_status_value, users_name, uid_1, field_data_field_punch_start_field_punch_start_value, field_data_field_team_field_team_tid, users_access
ORDER BY field_data_field_punch_start_field_punch_start_value DESC, users_access DESC
What you see between curly brackets (e.g. {field_data_field_team}) is the name of a database table. They are shown between curly brackets because the code that execute SQL queries replaces what there is between curly brackets with the prefix set for the database tables.
Suppose that your Drupal installation uses drupal7_ as prefix; the name of the table referred as {field_data_field_team} is drupal7_field_data_field_team.