Tоп – 10 бігунів у вікових категоріях

0-9.

Всі

SELECT 
		result.event_place as rank, 
		result.ID, 
		run.ID as run_id, 
		user.display_name as user, 
		first_name.meta_value as first_name, 
		last_name.meta_value as last_name, 
		user.ID as user_id, 
		run.date as date, 
		result.time as time, 
		
		location_post.post_title as location_title, 
		location_post.guid as location_link, 
		location_post.ID as location_id,

		club_post.post_title as club_title,
		club_post.guid as club_link,

		volunteer.volunteered as volunteered,
		is_only_volunteered.value as is_only_volunteered,
		result.volunteered as is_volunteered,
		role.title as volunteer_position,

		runner.runs as runs,

		personal_best.value as personal_best

		FROM (SELECT res1.ID, max(res1.run_id) as run_id, res1.user_id, res1.event_place, res1.time, volunteered, volunteer_position
			FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 0
			            AND datediff(now(), meta_value) / 365.25 < 10
					)
				
				) AS res1
			INNER JOIN (
				SELECT user_id, min(time) as time
	            FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 0
			            AND datediff(now(), meta_value) / 365.25 < 10
					)
				
				) AS res3
	            GROUP BY user_id
				) as res2
			ON (res2.user_id = res1.user_id AND res1.time = res2.time)
			GROUP BY user_id
		) as result
		
		LEFT JOIN wp_runday_run as run
		ON result.run_id = run.ID
		
		LEFT JOIN wp_posts as location_post
		ON run.location_id = location_post.ID
		
		LEFT JOIN wp_users as user
		ON result.user_id = user.ID
		
		LEFT JOIN wp_usermeta as first_name
		ON first_name.user_id = user.ID
	    AND first_name.meta_key = 'first_name'
		
		LEFT JOIN wp_usermeta as last_name
		ON last_name.user_id = user.ID
	    AND last_name.meta_key = 'last_name'
		
		LEFT JOIN wp_usermeta as club
		ON club.user_id = user.ID
	    AND club.meta_key = 'club'
		
		LEFT JOIN wp_posts as club_post
		ON club.meta_value = club_post.post_name
		AND club.meta_value != ''
		AND club_post.post_type = 'runday_club'

		LEFT JOIN (
			SELECT user_id, MIN(volunteered) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as is_only_volunteered
		ON is_only_volunteered.user_id = user.ID

		LEFT JOIN (
			SELECT user_id, MIN(time) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as personal_best
		ON personal_best.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, SUM(volunteered) as volunteered
			FROM (
	            SELECT user_id, MAX(volunteered) AS volunteered
				FROM wp_runday_result
				GROUP BY run_id, user_id) as volunteered_per_run
			GROUP BY user_id
			) as volunteer
		ON volunteer.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, count(*) as runs
			FROM (
	            SELECT user_id
				FROM wp_runday_result
				WHERE volunteered = 0) as only_runs
			GROUP BY user_id
			) as runner
		ON runner.user_id = user.ID

		LEFT JOIN wp_runday_volunteer_positions  as role
		ON result.volunteer_position = role.ID

		WHERE 1 = 1
		 ORDER BY  time ASC, volunteered DESCArray
(
    [0] => stdClass Object
        (
            [rank] => 0
            [ID] => 1796
            [run_id] => 91
            [user] => yarma@ukr.net
            [first_name] => Марина
            [last_name] => Ярмурська
            [user_id] => 543
            [date] => 2016-12-31 12:07:43
            [time] => 23:48:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 3
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 10
            [personal_best] => 23:48:00
        )

    [1] => stdClass Object
        (
            [rank] => 0
            [ID] => 1759
            [run_id] => 90
            [user] => t_o_v@ukr.net
            [first_name] => Соломія
            [last_name] => Турко
            [user_id] => 792
            [date] => 2016-12-31 11:55:01
            [time] => 25:04:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 25:04:00
        )

    [2] => stdClass Object
        (
            [rank] => 0
            [ID] => 4522
            [run_id] => 252
            [user] => eugenia.romanovskaya@gmail.com
            [first_name] => Евгения
            [last_name] => Романовская
            [user_id] => 864
            [date] => 2017-07-22 20:28:22
            [time] => 27:28:00
            [location_title] => Одеса: Парк Шевченка
            [location_link] => https://runday.org/?post_type=runday_location&p=25771
            [location_id] => 25771
            [club_title] => 
            [club_link] => 
            [volunteered] => 7
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 27:28:00
        )

    [3] => stdClass Object
        (
            [rank] => 0
            [ID] => 790
            [run_id] => 43
            [user] => martin.antonov.2017@mail.ru
            [first_name] => Мартин
            [last_name] => Антонов
            [user_id] => 359
            [date] => 2016-10-01 12:24:56
            [time] => 28:48:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 28:48:00
        )

    [4] => stdClass Object
        (
            [rank] => 0
            [ID] => 2379
            [run_id] => 125
            [user] => roman.petrychkovych@gmail.com
            [first_name] => Роман
            [last_name] => Петричкович
            [user_id] => 908
            [date] => 2017-03-04 21:55:09
            [time] => 30:27:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 30:27:00
        )

    [5] => stdClass Object
        (
            [rank] => 0
            [ID] => 615
            [run_id] => 36
            [user] => alinkamaftuliak22@gmail.com
            [first_name] => Alina
            [last_name] => Maftuliak
            [user_id] => 400
            [date] => 2016-09-24 09:21:50
            [time] => 31:30:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 31:30:00
        )

    [6] => stdClass Object
        (
            [rank] => 0
            [ID] => 212
            [run_id] => 15
            [user] => moconnellus@gmail.com
            [first_name] => Niko
            [last_name] => O'Connell
            [user_id] => 196
            [date] => 2016-08-13 09:16:59
            [time] => 39:26:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 39:26:00
        )

)
Місце Ім’я Час Локація
1 Марина Ярмурська 23:48:00 Тернопіль: Набережна ставу
2 Соломія Турко 25:04:00 Стрийський парк
3 Евгения Романовская 27:28:00 Одеса: Парк Шевченка
4 Мартин Антонов 28:48:00 Труханів Острів, Київ
5 Роман Петричкович 30:27:00 Стрийський парк
6 Alina Maftuliak 31:30:00 Стрийський парк
7 Niko O'Connell 39:26:00 Труханів Острів, Київ

Хлопчики

SELECT 
		result.event_place as rank, 
		result.ID, 
		run.ID as run_id, 
		user.display_name as user, 
		first_name.meta_value as first_name, 
		last_name.meta_value as last_name, 
		user.ID as user_id, 
		run.date as date, 
		result.time as time, 
		
		location_post.post_title as location_title, 
		location_post.guid as location_link, 
		location_post.ID as location_id,

		club_post.post_title as club_title,
		club_post.guid as club_link,

		volunteer.volunteered as volunteered,
		is_only_volunteered.value as is_only_volunteered,
		result.volunteered as is_volunteered,
		role.title as volunteer_position,

		runner.runs as runs,

		personal_best.value as personal_best

		FROM (SELECT res1.ID, max(res1.run_id) as run_id, res1.user_id, res1.event_place, res1.time, volunteered, volunteer_position
			FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 0
			            AND datediff(now(), meta_value) / 365.25 < 10
					)
				AND user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_sex'
			            AND meta_value = '1'
					)
				) AS res1
			INNER JOIN (
				SELECT user_id, min(time) as time
	            FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 0
			            AND datediff(now(), meta_value) / 365.25 < 10
					)
				AND user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_sex'
			            AND meta_value = '1'
					)
				) AS res3
	            GROUP BY user_id
				) as res2
			ON (res2.user_id = res1.user_id AND res1.time = res2.time)
			GROUP BY user_id
		) as result
		
		LEFT JOIN wp_runday_run as run
		ON result.run_id = run.ID
		
		LEFT JOIN wp_posts as location_post
		ON run.location_id = location_post.ID
		
		LEFT JOIN wp_users as user
		ON result.user_id = user.ID
		
		LEFT JOIN wp_usermeta as first_name
		ON first_name.user_id = user.ID
	    AND first_name.meta_key = 'first_name'
		
		LEFT JOIN wp_usermeta as last_name
		ON last_name.user_id = user.ID
	    AND last_name.meta_key = 'last_name'
		
		LEFT JOIN wp_usermeta as club
		ON club.user_id = user.ID
	    AND club.meta_key = 'club'
		
		LEFT JOIN wp_posts as club_post
		ON club.meta_value = club_post.post_name
		AND club.meta_value != ''
		AND club_post.post_type = 'runday_club'

		LEFT JOIN (
			SELECT user_id, MIN(volunteered) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as is_only_volunteered
		ON is_only_volunteered.user_id = user.ID

		LEFT JOIN (
			SELECT user_id, MIN(time) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as personal_best
		ON personal_best.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, SUM(volunteered) as volunteered
			FROM (
	            SELECT user_id, MAX(volunteered) AS volunteered
				FROM wp_runday_result
				GROUP BY run_id, user_id) as volunteered_per_run
			GROUP BY user_id
			) as volunteer
		ON volunteer.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, count(*) as runs
			FROM (
	            SELECT user_id
				FROM wp_runday_result
				WHERE volunteered = 0) as only_runs
			GROUP BY user_id
			) as runner
		ON runner.user_id = user.ID

		LEFT JOIN wp_runday_volunteer_positions  as role
		ON result.volunteer_position = role.ID

		WHERE 1 = 1
		 ORDER BY  time ASC, volunteered DESCArray
(
    [0] => stdClass Object
        (
            [rank] => 0
            [ID] => 790
            [run_id] => 43
            [user] => martin.antonov.2017@mail.ru
            [first_name] => Мартин
            [last_name] => Антонов
            [user_id] => 359
            [date] => 2016-10-01 12:24:56
            [time] => 28:48:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 28:48:00
        )

    [1] => stdClass Object
        (
            [rank] => 0
            [ID] => 2379
            [run_id] => 125
            [user] => roman.petrychkovych@gmail.com
            [first_name] => Роман
            [last_name] => Петричкович
            [user_id] => 908
            [date] => 2017-03-04 21:55:09
            [time] => 30:27:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 30:27:00
        )

    [2] => stdClass Object
        (
            [rank] => 0
            [ID] => 212
            [run_id] => 15
            [user] => moconnellus@gmail.com
            [first_name] => Niko
            [last_name] => O'Connell
            [user_id] => 196
            [date] => 2016-08-13 09:16:59
            [time] => 39:26:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 39:26:00
        )

)
Місце Ім’я Час Локація
1 Мартин Антонов 28:48:00 Труханів Острів, Київ
2 Роман Петричкович 30:27:00 Стрийський парк
3 Niko O'Connell 39:26:00 Труханів Острів, Київ

Дівчатка

SELECT 
		result.event_place as rank, 
		result.ID, 
		run.ID as run_id, 
		user.display_name as user, 
		first_name.meta_value as first_name, 
		last_name.meta_value as last_name, 
		user.ID as user_id, 
		run.date as date, 
		result.time as time, 
		
		location_post.post_title as location_title, 
		location_post.guid as location_link, 
		location_post.ID as location_id,

		club_post.post_title as club_title,
		club_post.guid as club_link,

		volunteer.volunteered as volunteered,
		is_only_volunteered.value as is_only_volunteered,
		result.volunteered as is_volunteered,
		role.title as volunteer_position,

		runner.runs as runs,

		personal_best.value as personal_best

		FROM (SELECT res1.ID, max(res1.run_id) as run_id, res1.user_id, res1.event_place, res1.time, volunteered, volunteer_position
			FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 0
			            AND datediff(now(), meta_value) / 365.25 < 10
					)
				AND user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_sex'
			            AND meta_value = '2'
					)
				) AS res1
			INNER JOIN (
				SELECT user_id, min(time) as time
	            FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 0
			            AND datediff(now(), meta_value) / 365.25 < 10
					)
				AND user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_sex'
			            AND meta_value = '2'
					)
				) AS res3
	            GROUP BY user_id
				) as res2
			ON (res2.user_id = res1.user_id AND res1.time = res2.time)
			GROUP BY user_id
		) as result
		
		LEFT JOIN wp_runday_run as run
		ON result.run_id = run.ID
		
		LEFT JOIN wp_posts as location_post
		ON run.location_id = location_post.ID
		
		LEFT JOIN wp_users as user
		ON result.user_id = user.ID
		
		LEFT JOIN wp_usermeta as first_name
		ON first_name.user_id = user.ID
	    AND first_name.meta_key = 'first_name'
		
		LEFT JOIN wp_usermeta as last_name
		ON last_name.user_id = user.ID
	    AND last_name.meta_key = 'last_name'
		
		LEFT JOIN wp_usermeta as club
		ON club.user_id = user.ID
	    AND club.meta_key = 'club'
		
		LEFT JOIN wp_posts as club_post
		ON club.meta_value = club_post.post_name
		AND club.meta_value != ''
		AND club_post.post_type = 'runday_club'

		LEFT JOIN (
			SELECT user_id, MIN(volunteered) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as is_only_volunteered
		ON is_only_volunteered.user_id = user.ID

		LEFT JOIN (
			SELECT user_id, MIN(time) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as personal_best
		ON personal_best.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, SUM(volunteered) as volunteered
			FROM (
	            SELECT user_id, MAX(volunteered) AS volunteered
				FROM wp_runday_result
				GROUP BY run_id, user_id) as volunteered_per_run
			GROUP BY user_id
			) as volunteer
		ON volunteer.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, count(*) as runs
			FROM (
	            SELECT user_id
				FROM wp_runday_result
				WHERE volunteered = 0) as only_runs
			GROUP BY user_id
			) as runner
		ON runner.user_id = user.ID

		LEFT JOIN wp_runday_volunteer_positions  as role
		ON result.volunteer_position = role.ID

		WHERE 1 = 1
		 ORDER BY  time ASC, volunteered DESCArray
(
    [0] => stdClass Object
        (
            [rank] => 0
            [ID] => 1796
            [run_id] => 91
            [user] => yarma@ukr.net
            [first_name] => Марина
            [last_name] => Ярмурська
            [user_id] => 543
            [date] => 2016-12-31 12:07:43
            [time] => 23:48:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 3
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 10
            [personal_best] => 23:48:00
        )

    [1] => stdClass Object
        (
            [rank] => 0
            [ID] => 1759
            [run_id] => 90
            [user] => t_o_v@ukr.net
            [first_name] => Соломія
            [last_name] => Турко
            [user_id] => 792
            [date] => 2016-12-31 11:55:01
            [time] => 25:04:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 25:04:00
        )

    [2] => stdClass Object
        (
            [rank] => 0
            [ID] => 4522
            [run_id] => 252
            [user] => eugenia.romanovskaya@gmail.com
            [first_name] => Евгения
            [last_name] => Романовская
            [user_id] => 864
            [date] => 2017-07-22 20:28:22
            [time] => 27:28:00
            [location_title] => Одеса: Парк Шевченка
            [location_link] => https://runday.org/?post_type=runday_location&p=25771
            [location_id] => 25771
            [club_title] => 
            [club_link] => 
            [volunteered] => 7
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 27:28:00
        )

    [3] => stdClass Object
        (
            [rank] => 0
            [ID] => 615
            [run_id] => 36
            [user] => alinkamaftuliak22@gmail.com
            [first_name] => Alina
            [last_name] => Maftuliak
            [user_id] => 400
            [date] => 2016-09-24 09:21:50
            [time] => 31:30:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 31:30:00
        )

)
Місце Ім’я Час Локація
1 Марина Ярмурська 23:48:00 Тернопіль: Набережна ставу
2 Соломія Турко 25:04:00 Стрийський парк
3 Евгения Романовская 27:28:00 Одеса: Парк Шевченка
4 Alina Maftuliak 31:30:00 Стрийський парк

10-14.

Всі

SELECT 
		result.event_place as rank, 
		result.ID, 
		run.ID as run_id, 
		user.display_name as user, 
		first_name.meta_value as first_name, 
		last_name.meta_value as last_name, 
		user.ID as user_id, 
		run.date as date, 
		result.time as time, 
		
		location_post.post_title as location_title, 
		location_post.guid as location_link, 
		location_post.ID as location_id,

		club_post.post_title as club_title,
		club_post.guid as club_link,

		volunteer.volunteered as volunteered,
		is_only_volunteered.value as is_only_volunteered,
		result.volunteered as is_volunteered,
		role.title as volunteer_position,

		runner.runs as runs,

		personal_best.value as personal_best

		FROM (SELECT res1.ID, max(res1.run_id) as run_id, res1.user_id, res1.event_place, res1.time, volunteered, volunteer_position
			FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 10
			            AND datediff(now(), meta_value) / 365.25 < 15
					)
				
				) AS res1
			INNER JOIN (
				SELECT user_id, min(time) as time
	            FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 10
			            AND datediff(now(), meta_value) / 365.25 < 15
					)
				
				) AS res3
	            GROUP BY user_id
				) as res2
			ON (res2.user_id = res1.user_id AND res1.time = res2.time)
			GROUP BY user_id
		) as result
		
		LEFT JOIN wp_runday_run as run
		ON result.run_id = run.ID
		
		LEFT JOIN wp_posts as location_post
		ON run.location_id = location_post.ID
		
		LEFT JOIN wp_users as user
		ON result.user_id = user.ID
		
		LEFT JOIN wp_usermeta as first_name
		ON first_name.user_id = user.ID
	    AND first_name.meta_key = 'first_name'
		
		LEFT JOIN wp_usermeta as last_name
		ON last_name.user_id = user.ID
	    AND last_name.meta_key = 'last_name'
		
		LEFT JOIN wp_usermeta as club
		ON club.user_id = user.ID
	    AND club.meta_key = 'club'
		
		LEFT JOIN wp_posts as club_post
		ON club.meta_value = club_post.post_name
		AND club.meta_value != ''
		AND club_post.post_type = 'runday_club'

		LEFT JOIN (
			SELECT user_id, MIN(volunteered) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as is_only_volunteered
		ON is_only_volunteered.user_id = user.ID

		LEFT JOIN (
			SELECT user_id, MIN(time) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as personal_best
		ON personal_best.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, SUM(volunteered) as volunteered
			FROM (
	            SELECT user_id, MAX(volunteered) AS volunteered
				FROM wp_runday_result
				GROUP BY run_id, user_id) as volunteered_per_run
			GROUP BY user_id
			) as volunteer
		ON volunteer.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, count(*) as runs
			FROM (
	            SELECT user_id
				FROM wp_runday_result
				WHERE volunteered = 0) as only_runs
			GROUP BY user_id
			) as runner
		ON runner.user_id = user.ID

		LEFT JOIN wp_runday_volunteer_positions  as role
		ON result.volunteer_position = role.ID

		WHERE 1 = 1
		 ORDER BY  time ASC, volunteered DESCArray
(
    [0] => stdClass Object
        (
            [rank] => 0
            [ID] => 4169
            [run_id] => 227
            [user] => vlada.nazarenko@icloud.com
            [first_name] => Влада
            [last_name] => Назаренко
            [user_id] => 732
            [date] => 2017-07-01 12:06:08
            [time] => 21:18:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 21:18:00
        )

    [1] => stdClass Object
        (
            [rank] => 0
            [ID] => 865
            [run_id] => 44
            [user] => Will Laitinen
            [first_name] => Will
            [last_name] => Laitinen
            [user_id] => 465
            [date] => 2016-10-08 09:04:10
            [time] => 25:37:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => PSI Panthers Cross Country Team
            [club_link] => https://runday.org/?post_type=runday_club&p=24884
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 25:37:00
        )

    [2] => stdClass Object
        (
            [rank] => 0
            [ID] => 871
            [run_id] => 44
            [user] => Jana Kent
            [first_name] => Jana
            [last_name] => Kent
            [user_id] => 466
            [date] => 2016-10-08 09:04:10
            [time] => 28:46:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => PSI Panthers Cross Country Team
            [club_link] => https://runday.org/?post_type=runday_club&p=24884
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 28:46:00
        )

    [3] => stdClass Object
        (
            [rank] => 0
            [ID] => 1336
            [run_id] => 67
            [user] => ulianacherevko@gmail.com
            [first_name] => Улянка
            [last_name] => Черевко
            [user_id] => 639
            [date] => 2016-11-19 11:58:18
            [time] => 29:36:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 6
            [personal_best] => 29:36:00
        )

    [4] => stdClass Object
        (
            [rank] => 7
            [ID] => 65
            [run_id] => 9
            [user] => bishylove@yahoo.com
            [first_name] => Opeyemi
            [last_name] => Emmanuel
            [user_id] => 147
            [date] => 2016-08-06 08:45:46
            [time] => 30:50:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 30:50:00
        )

    [5] => stdClass Object
        (
            [rank] => 0
            [ID] => 1465
            [run_id] => 74
            [user] => lukashevy4@gmail.com
            [first_name] => Ангеліна
            [last_name] => Лукашевич
            [user_id] => 658
            [date] => 2016-11-26 13:55:23
            [time] => 33:31:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 33:31:00
        )

    [6] => stdClass Object
        (
            [rank] => 0
            [ID] => 1731
            [run_id] => 89
            [user] => markvmor@gmail.com
            [first_name] => Mark
            [last_name] => Morozov
            [user_id] => 755
            [date] => 2016-12-31 11:47:21
            [time] => 36:31:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 36:31:00
        )

    [7] => stdClass Object
        (
            [rank] => 0
            [ID] => 974
            [run_id] => 57
            [user] => voznyroma1982@gmail.com
            [first_name] => ДАРІЙ
            [last_name] => ВОЗНИЙ
            [user_id] => 563
            [date] => 2016-10-29 09:56:09
            [time] => 59:59:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 2
            [is_only_volunteered] => 1
            [is_volunteered] => 1
            [volunteer_position] => Tokens
            [runs] => 
            [personal_best] => 59:59:00
        )

)
Місце Ім’я Час Локація
1 Влада Назаренко 21:18:00 Труханів Острів, Київ
2 Will Laitinen 25:37:00 Труханів Острів, Київ
3 Jana Kent 28:46:00 Труханів Острів, Київ
4 Улянка Черевко 29:36:00 Стрийський парк
5 Opeyemi Emmanuel 30:50:00 Труханів Острів, Київ
6 Ангеліна Лукашевич 33:31:00 Стрийський парк
7 Mark Morozov 36:31:00 Труханів Острів, Київ

Хлопці

SELECT 
		result.event_place as rank, 
		result.ID, 
		run.ID as run_id, 
		user.display_name as user, 
		first_name.meta_value as first_name, 
		last_name.meta_value as last_name, 
		user.ID as user_id, 
		run.date as date, 
		result.time as time, 
		
		location_post.post_title as location_title, 
		location_post.guid as location_link, 
		location_post.ID as location_id,

		club_post.post_title as club_title,
		club_post.guid as club_link,

		volunteer.volunteered as volunteered,
		is_only_volunteered.value as is_only_volunteered,
		result.volunteered as is_volunteered,
		role.title as volunteer_position,

		runner.runs as runs,

		personal_best.value as personal_best

		FROM (SELECT res1.ID, max(res1.run_id) as run_id, res1.user_id, res1.event_place, res1.time, volunteered, volunteer_position
			FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 10
			            AND datediff(now(), meta_value) / 365.25 < 15
					)
				AND user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_sex'
			            AND meta_value = '1'
					)
				) AS res1
			INNER JOIN (
				SELECT user_id, min(time) as time
	            FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 10
			            AND datediff(now(), meta_value) / 365.25 < 15
					)
				AND user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_sex'
			            AND meta_value = '1'
					)
				) AS res3
	            GROUP BY user_id
				) as res2
			ON (res2.user_id = res1.user_id AND res1.time = res2.time)
			GROUP BY user_id
		) as result
		
		LEFT JOIN wp_runday_run as run
		ON result.run_id = run.ID
		
		LEFT JOIN wp_posts as location_post
		ON run.location_id = location_post.ID
		
		LEFT JOIN wp_users as user
		ON result.user_id = user.ID
		
		LEFT JOIN wp_usermeta as first_name
		ON first_name.user_id = user.ID
	    AND first_name.meta_key = 'first_name'
		
		LEFT JOIN wp_usermeta as last_name
		ON last_name.user_id = user.ID
	    AND last_name.meta_key = 'last_name'
		
		LEFT JOIN wp_usermeta as club
		ON club.user_id = user.ID
	    AND club.meta_key = 'club'
		
		LEFT JOIN wp_posts as club_post
		ON club.meta_value = club_post.post_name
		AND club.meta_value != ''
		AND club_post.post_type = 'runday_club'

		LEFT JOIN (
			SELECT user_id, MIN(volunteered) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as is_only_volunteered
		ON is_only_volunteered.user_id = user.ID

		LEFT JOIN (
			SELECT user_id, MIN(time) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as personal_best
		ON personal_best.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, SUM(volunteered) as volunteered
			FROM (
	            SELECT user_id, MAX(volunteered) AS volunteered
				FROM wp_runday_result
				GROUP BY run_id, user_id) as volunteered_per_run
			GROUP BY user_id
			) as volunteer
		ON volunteer.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, count(*) as runs
			FROM (
	            SELECT user_id
				FROM wp_runday_result
				WHERE volunteered = 0) as only_runs
			GROUP BY user_id
			) as runner
		ON runner.user_id = user.ID

		LEFT JOIN wp_runday_volunteer_positions  as role
		ON result.volunteer_position = role.ID

		WHERE 1 = 1
		 ORDER BY  time ASC, volunteered DESCArray
(
    [0] => stdClass Object
        (
            [rank] => 0
            [ID] => 865
            [run_id] => 44
            [user] => Will Laitinen
            [first_name] => Will
            [last_name] => Laitinen
            [user_id] => 465
            [date] => 2016-10-08 09:04:10
            [time] => 25:37:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => PSI Panthers Cross Country Team
            [club_link] => https://runday.org/?post_type=runday_club&p=24884
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 25:37:00
        )

    [1] => stdClass Object
        (
            [rank] => 7
            [ID] => 65
            [run_id] => 9
            [user] => bishylove@yahoo.com
            [first_name] => Opeyemi
            [last_name] => Emmanuel
            [user_id] => 147
            [date] => 2016-08-06 08:45:46
            [time] => 30:50:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 30:50:00
        )

    [2] => stdClass Object
        (
            [rank] => 0
            [ID] => 1731
            [run_id] => 89
            [user] => markvmor@gmail.com
            [first_name] => Mark
            [last_name] => Morozov
            [user_id] => 755
            [date] => 2016-12-31 11:47:21
            [time] => 36:31:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 36:31:00
        )

    [3] => stdClass Object
        (
            [rank] => 0
            [ID] => 974
            [run_id] => 57
            [user] => voznyroma1982@gmail.com
            [first_name] => ДАРІЙ
            [last_name] => ВОЗНИЙ
            [user_id] => 563
            [date] => 2016-10-29 09:56:09
            [time] => 59:59:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 2
            [is_only_volunteered] => 1
            [is_volunteered] => 1
            [volunteer_position] => Tokens
            [runs] => 
            [personal_best] => 59:59:00
        )

)
Місце Ім’я Час Локація
1 Will Laitinen 25:37:00 Труханів Острів, Київ
2 Opeyemi Emmanuel 30:50:00 Труханів Острів, Київ
3 Mark Morozov 36:31:00 Труханів Острів, Київ

Дівчата

SELECT 
		result.event_place as rank, 
		result.ID, 
		run.ID as run_id, 
		user.display_name as user, 
		first_name.meta_value as first_name, 
		last_name.meta_value as last_name, 
		user.ID as user_id, 
		run.date as date, 
		result.time as time, 
		
		location_post.post_title as location_title, 
		location_post.guid as location_link, 
		location_post.ID as location_id,

		club_post.post_title as club_title,
		club_post.guid as club_link,

		volunteer.volunteered as volunteered,
		is_only_volunteered.value as is_only_volunteered,
		result.volunteered as is_volunteered,
		role.title as volunteer_position,

		runner.runs as runs,

		personal_best.value as personal_best

		FROM (SELECT res1.ID, max(res1.run_id) as run_id, res1.user_id, res1.event_place, res1.time, volunteered, volunteer_position
			FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 10
			            AND datediff(now(), meta_value) / 365.25 < 15
					)
				AND user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_sex'
			            AND meta_value = '2'
					)
				) AS res1
			INNER JOIN (
				SELECT user_id, min(time) as time
	            FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 10
			            AND datediff(now(), meta_value) / 365.25 < 15
					)
				AND user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_sex'
			            AND meta_value = '2'
					)
				) AS res3
	            GROUP BY user_id
				) as res2
			ON (res2.user_id = res1.user_id AND res1.time = res2.time)
			GROUP BY user_id
		) as result
		
		LEFT JOIN wp_runday_run as run
		ON result.run_id = run.ID
		
		LEFT JOIN wp_posts as location_post
		ON run.location_id = location_post.ID
		
		LEFT JOIN wp_users as user
		ON result.user_id = user.ID
		
		LEFT JOIN wp_usermeta as first_name
		ON first_name.user_id = user.ID
	    AND first_name.meta_key = 'first_name'
		
		LEFT JOIN wp_usermeta as last_name
		ON last_name.user_id = user.ID
	    AND last_name.meta_key = 'last_name'
		
		LEFT JOIN wp_usermeta as club
		ON club.user_id = user.ID
	    AND club.meta_key = 'club'
		
		LEFT JOIN wp_posts as club_post
		ON club.meta_value = club_post.post_name
		AND club.meta_value != ''
		AND club_post.post_type = 'runday_club'

		LEFT JOIN (
			SELECT user_id, MIN(volunteered) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as is_only_volunteered
		ON is_only_volunteered.user_id = user.ID

		LEFT JOIN (
			SELECT user_id, MIN(time) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as personal_best
		ON personal_best.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, SUM(volunteered) as volunteered
			FROM (
	            SELECT user_id, MAX(volunteered) AS volunteered
				FROM wp_runday_result
				GROUP BY run_id, user_id) as volunteered_per_run
			GROUP BY user_id
			) as volunteer
		ON volunteer.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, count(*) as runs
			FROM (
	            SELECT user_id
				FROM wp_runday_result
				WHERE volunteered = 0) as only_runs
			GROUP BY user_id
			) as runner
		ON runner.user_id = user.ID

		LEFT JOIN wp_runday_volunteer_positions  as role
		ON result.volunteer_position = role.ID

		WHERE 1 = 1
		 ORDER BY  time ASC, volunteered DESCArray
(
    [0] => stdClass Object
        (
            [rank] => 0
            [ID] => 4169
            [run_id] => 227
            [user] => vlada.nazarenko@icloud.com
            [first_name] => Влада
            [last_name] => Назаренко
            [user_id] => 732
            [date] => 2017-07-01 12:06:08
            [time] => 21:18:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 21:18:00
        )

    [1] => stdClass Object
        (
            [rank] => 0
            [ID] => 871
            [run_id] => 44
            [user] => Jana Kent
            [first_name] => Jana
            [last_name] => Kent
            [user_id] => 466
            [date] => 2016-10-08 09:04:10
            [time] => 28:46:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => PSI Panthers Cross Country Team
            [club_link] => https://runday.org/?post_type=runday_club&p=24884
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 28:46:00
        )

    [2] => stdClass Object
        (
            [rank] => 0
            [ID] => 1336
            [run_id] => 67
            [user] => ulianacherevko@gmail.com
            [first_name] => Улянка
            [last_name] => Черевко
            [user_id] => 639
            [date] => 2016-11-19 11:58:18
            [time] => 29:36:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 6
            [personal_best] => 29:36:00
        )

    [3] => stdClass Object
        (
            [rank] => 0
            [ID] => 1465
            [run_id] => 74
            [user] => lukashevy4@gmail.com
            [first_name] => Ангеліна
            [last_name] => Лукашевич
            [user_id] => 658
            [date] => 2016-11-26 13:55:23
            [time] => 33:31:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 33:31:00
        )

)
Місце Ім’я Час Локація
1 Влада Назаренко 21:18:00 Труханів Острів, Київ
2 Jana Kent 28:46:00 Труханів Острів, Київ
3 Улянка Черевко 29:36:00 Стрийський парк
4 Ангеліна Лукашевич 33:31:00 Стрийський парк

15-19.

Всі

SELECT 
		result.event_place as rank, 
		result.ID, 
		run.ID as run_id, 
		user.display_name as user, 
		first_name.meta_value as first_name, 
		last_name.meta_value as last_name, 
		user.ID as user_id, 
		run.date as date, 
		result.time as time, 
		
		location_post.post_title as location_title, 
		location_post.guid as location_link, 
		location_post.ID as location_id,

		club_post.post_title as club_title,
		club_post.guid as club_link,

		volunteer.volunteered as volunteered,
		is_only_volunteered.value as is_only_volunteered,
		result.volunteered as is_volunteered,
		role.title as volunteer_position,

		runner.runs as runs,

		personal_best.value as personal_best

		FROM (SELECT res1.ID, max(res1.run_id) as run_id, res1.user_id, res1.event_place, res1.time, volunteered, volunteer_position
			FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 15
			            AND datediff(now(), meta_value) / 365.25 < 20
					)
				
				) AS res1
			INNER JOIN (
				SELECT user_id, min(time) as time
	            FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 15
			            AND datediff(now(), meta_value) / 365.25 < 20
					)
				
				) AS res3
	            GROUP BY user_id
				) as res2
			ON (res2.user_id = res1.user_id AND res1.time = res2.time)
			GROUP BY user_id
		) as result
		
		LEFT JOIN wp_runday_run as run
		ON result.run_id = run.ID
		
		LEFT JOIN wp_posts as location_post
		ON run.location_id = location_post.ID
		
		LEFT JOIN wp_users as user
		ON result.user_id = user.ID
		
		LEFT JOIN wp_usermeta as first_name
		ON first_name.user_id = user.ID
	    AND first_name.meta_key = 'first_name'
		
		LEFT JOIN wp_usermeta as last_name
		ON last_name.user_id = user.ID
	    AND last_name.meta_key = 'last_name'
		
		LEFT JOIN wp_usermeta as club
		ON club.user_id = user.ID
	    AND club.meta_key = 'club'
		
		LEFT JOIN wp_posts as club_post
		ON club.meta_value = club_post.post_name
		AND club.meta_value != ''
		AND club_post.post_type = 'runday_club'

		LEFT JOIN (
			SELECT user_id, MIN(volunteered) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as is_only_volunteered
		ON is_only_volunteered.user_id = user.ID

		LEFT JOIN (
			SELECT user_id, MIN(time) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as personal_best
		ON personal_best.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, SUM(volunteered) as volunteered
			FROM (
	            SELECT user_id, MAX(volunteered) AS volunteered
				FROM wp_runday_result
				GROUP BY run_id, user_id) as volunteered_per_run
			GROUP BY user_id
			) as volunteer
		ON volunteer.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, count(*) as runs
			FROM (
	            SELECT user_id
				FROM wp_runday_result
				WHERE volunteered = 0) as only_runs
			GROUP BY user_id
			) as runner
		ON runner.user_id = user.ID

		LEFT JOIN wp_runday_volunteer_positions  as role
		ON result.volunteer_position = role.ID

		WHERE 1 = 1
		 ORDER BY  time ASC, volunteered DESCArray
(
    [0] => stdClass Object
        (
            [rank] => 0
            [ID] => 181
            [run_id] => 15
            [user] => roman.xoxich@mail.ru
            [first_name] => Роман
            [last_name] => Хохич
            [user_id] => 204
            [date] => 2016-08-13 09:16:59
            [time] => 18:14:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 18:14:00
        )

    [1] => stdClass Object
        (
            [rank] => 0
            [ID] => 1142
            [run_id] => 58
            [user] => aewyqlol@gmail.com
            [first_name] => Святослав
            [last_name] => Гніздовський
            [user_id] => 450
            [date] => 2016-11-05 09:26:08
            [time] => 21:18:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 21:18:00
        )

    [2] => stdClass Object
        (
            [rank] => 0
            [ID] => 1143
            [run_id] => 58
            [user] => kuzmych@ucu.edu.ua
            [first_name] => Артем
            [last_name] => Кузьмич
            [user_id] => 613
            [date] => 2016-11-05 09:26:08
            [time] => 21:25:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 21:25:00
        )

    [3] => stdClass Object
        (
            [rank] => 0
            [ID] => 2478
            [run_id] => 131
            [user] => nazarp06@gmail.com
            [first_name] => Назар
            [last_name] => Полевий
            [user_id] => 650
            [date] => 2017-03-18 16:25:20
            [time] => 21:25:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 21:25:00
        )

    [4] => stdClass Object
        (
            [rank] => 0
            [ID] => 1697
            [run_id] => 89
            [user] => m_tym@ukr.net
            [first_name] => Mariia
            [last_name] => Tymoshchuk
            [user_id] => 697
            [date] => 2016-12-31 11:47:21
            [time] => 21:47:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 21:47:00
        )

    [5] => stdClass Object
        (
            [rank] => 0
            [ID] => 1005
            [run_id] => 52
            [user] => 3dma77@gmail.com
            [first_name] => Дмитро
            [last_name] => Зарихта
            [user_id] => 531
            [date] => 2016-10-22 09:26:40
            [time] => 22:26:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 5
            [personal_best] => 22:26:00
        )

    [6] => stdClass Object
        (
            [rank] => 0
            [ID] => 2203
            [run_id] => 117
            [user] => pslavik77@gmail.com
            [first_name] => Ярослав
            [last_name] => Пастух
            [user_id] => 862
            [date] => 2017-02-21 22:36:21
            [time] => 24:11:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 24:11:00
        )

    [7] => stdClass Object
        (
            [rank] => 0
            [ID] => 2546
            [run_id] => 134
            [user] => lbabiy@softserveinc.com
            [first_name] => Людмила
            [last_name] => Бабій
            [user_id] => 672
            [date] => 2017-03-25 23:57:24
            [time] => 24:28:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 5
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 24:28:00
        )

    [8] => stdClass Object
        (
            [rank] => 0
            [ID] => 860
            [run_id] => 44
            [user] => Katerina Schmidt
            [first_name] => Katerina
            [last_name] => Schmidt
            [user_id] => 464
            [date] => 2016-10-08 09:04:10
            [time] => 24:41:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => PSI Panthers Cross Country Team
            [club_link] => https://runday.org/?post_type=runday_club&p=24884
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 24:41:00
        )

    [9] => stdClass Object
        (
            [rank] => 0
            [ID] => 900
            [run_id] => 46
            [user] => Zoya Schmidt
            [first_name] => Zoya
            [last_name] => Schmidt
            [user_id] => 463
            [date] => 2016-10-15 07:53:58
            [time] => 25:06:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => PSI Panthers Cross Country Team
            [club_link] => https://runday.org/?post_type=runday_club&p=24884
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 25:06:00
        )

    [10] => stdClass Object
        (
            [rank] => 0
            [ID] => 903
            [run_id] => 46
            [user] => Anna Bugay
            [first_name] => Anna
            [last_name] => Bugay
            [user_id] => 469
            [date] => 2016-10-15 07:53:58
            [time] => 27:31:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => PSI Panthers Cross Country Team
            [club_link] => https://runday.org/?post_type=runday_club&p=24884
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 27:31:00
        )

    [11] => stdClass Object
        (
            [rank] => 0
            [ID] => 3033
            [run_id] => 153
            [user] => mad.taras@gmail.com
            [first_name] => Тарас
            [last_name] => Мазуркевич
            [user_id] => 821
            [date] => 2017-04-15 21:00:46
            [time] => 27:38:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 27:38:00
        )

    [12] => stdClass Object
        (
            [rank] => 0
            [ID] => 904
            [run_id] => 46
            [user] => Nikolai Lawrence
            [first_name] => Nikolai
            [last_name] => Lawrence
            [user_id] => 468
            [date] => 2016-10-15 07:53:58
            [time] => 28:21:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => PSI Panthers Cross Country Team
            [club_link] => https://runday.org/?post_type=runday_club&p=24884
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 28:21:00
        )

    [13] => stdClass Object
        (
            [rank] => 0
            [ID] => 905
            [run_id] => 46
            [user] => mr.boss.senator@mail.ru
            [first_name] => Антон
            [last_name] => Митрофанов
            [user_id] => 310
            [date] => 2016-10-15 07:53:58
            [time] => 28:29:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 28:29:00
        )

    [14] => stdClass Object
        (
            [rank] => 0
            [ID] => 1772
            [run_id] => 90
            [user] => anna171e@gmail.com
            [first_name] => Анна
            [last_name] => Євстратьєва
            [user_id] => 759
            [date] => 2016-12-31 11:55:01
            [time] => 28:45:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 28:45:00
        )

    [15] => stdClass Object
        (
            [rank] => 0
            [ID] => 872
            [run_id] => 44
            [user] => Jessica Cairns
            [first_name] => Jessica
            [last_name] => Cairns
            [user_id] => 470
            [date] => 2016-10-08 09:04:10
            [time] => 28:46:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => PSI Panthers Cross Country Team
            [club_link] => https://runday.org/?post_type=runday_club&p=24884
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 28:46:00
        )

    [16] => stdClass Object
        (
            [rank] => 0
            [ID] => 2828
            [run_id] => 142
            [user] => MK1589@yandex.ua
            [first_name] => Марина
            [last_name] => Ковальова
            [user_id] => 900
            [date] => 2017-04-01 11:57:35
            [time] => 34:53:00
            [location_title] => Одеса: Парк Шевченка
            [location_link] => https://runday.org/?post_type=runday_location&p=25771
            [location_id] => 25771
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 34:53:00
        )

    [17] => stdClass Object
        (
            [rank] => 0
            [ID] => 641
            [run_id] => 47
            [user] => sofi0207@gmail.com
            [first_name] => Софія
            [last_name] => Данильчак
            [user_id] => 396
            [date] => 2016-10-15 08:02:51
            [time] => 59:59:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 2
            [is_only_volunteered] => 1
            [is_volunteered] => 1
            [volunteer_position] => Tokens
            [runs] => 
            [personal_best] => 59:59:00
        )

)
Місце Ім’я Час Локація
1 Роман Хохич 18:14:00 Труханів Острів, Київ
2 Святослав Гніздовський 21:18:00 Стрийський парк
3 Артем Кузьмич 21:25:00 Стрийський парк
4 Назар Полевий 21:25:00 Стрийський парк
5 Mariia Tymoshchuk 21:47:00 Труханів Острів, Київ
6 Дмитро Зарихта 22:26:00 Тернопіль: Набережна ставу
7 Ярослав Пастух 24:11:00 Тернопіль: Набережна ставу
8 Людмила Бабій 24:28:00 Стрийський парк
9 Katerina Schmidt 24:41:00 Труханів Острів, Київ
10 Zoya Schmidt 25:06:00 Труханів Острів, Київ

Хлопці

SELECT 
		result.event_place as rank, 
		result.ID, 
		run.ID as run_id, 
		user.display_name as user, 
		first_name.meta_value as first_name, 
		last_name.meta_value as last_name, 
		user.ID as user_id, 
		run.date as date, 
		result.time as time, 
		
		location_post.post_title as location_title, 
		location_post.guid as location_link, 
		location_post.ID as location_id,

		club_post.post_title as club_title,
		club_post.guid as club_link,

		volunteer.volunteered as volunteered,
		is_only_volunteered.value as is_only_volunteered,
		result.volunteered as is_volunteered,
		role.title as volunteer_position,

		runner.runs as runs,

		personal_best.value as personal_best

		FROM (SELECT res1.ID, max(res1.run_id) as run_id, res1.user_id, res1.event_place, res1.time, volunteered, volunteer_position
			FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 15
			            AND datediff(now(), meta_value) / 365.25 < 20
					)
				AND user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_sex'
			            AND meta_value = '1'
					)
				) AS res1
			INNER JOIN (
				SELECT user_id, min(time) as time
	            FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 15
			            AND datediff(now(), meta_value) / 365.25 < 20
					)
				AND user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_sex'
			            AND meta_value = '1'
					)
				) AS res3
	            GROUP BY user_id
				) as res2
			ON (res2.user_id = res1.user_id AND res1.time = res2.time)
			GROUP BY user_id
		) as result
		
		LEFT JOIN wp_runday_run as run
		ON result.run_id = run.ID
		
		LEFT JOIN wp_posts as location_post
		ON run.location_id = location_post.ID
		
		LEFT JOIN wp_users as user
		ON result.user_id = user.ID
		
		LEFT JOIN wp_usermeta as first_name
		ON first_name.user_id = user.ID
	    AND first_name.meta_key = 'first_name'
		
		LEFT JOIN wp_usermeta as last_name
		ON last_name.user_id = user.ID
	    AND last_name.meta_key = 'last_name'
		
		LEFT JOIN wp_usermeta as club
		ON club.user_id = user.ID
	    AND club.meta_key = 'club'
		
		LEFT JOIN wp_posts as club_post
		ON club.meta_value = club_post.post_name
		AND club.meta_value != ''
		AND club_post.post_type = 'runday_club'

		LEFT JOIN (
			SELECT user_id, MIN(volunteered) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as is_only_volunteered
		ON is_only_volunteered.user_id = user.ID

		LEFT JOIN (
			SELECT user_id, MIN(time) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as personal_best
		ON personal_best.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, SUM(volunteered) as volunteered
			FROM (
	            SELECT user_id, MAX(volunteered) AS volunteered
				FROM wp_runday_result
				GROUP BY run_id, user_id) as volunteered_per_run
			GROUP BY user_id
			) as volunteer
		ON volunteer.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, count(*) as runs
			FROM (
	            SELECT user_id
				FROM wp_runday_result
				WHERE volunteered = 0) as only_runs
			GROUP BY user_id
			) as runner
		ON runner.user_id = user.ID

		LEFT JOIN wp_runday_volunteer_positions  as role
		ON result.volunteer_position = role.ID

		WHERE 1 = 1
		 ORDER BY  time ASC, volunteered DESCArray
(
    [0] => stdClass Object
        (
            [rank] => 0
            [ID] => 181
            [run_id] => 15
            [user] => roman.xoxich@mail.ru
            [first_name] => Роман
            [last_name] => Хохич
            [user_id] => 204
            [date] => 2016-08-13 09:16:59
            [time] => 18:14:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 18:14:00
        )

    [1] => stdClass Object
        (
            [rank] => 0
            [ID] => 1142
            [run_id] => 58
            [user] => aewyqlol@gmail.com
            [first_name] => Святослав
            [last_name] => Гніздовський
            [user_id] => 450
            [date] => 2016-11-05 09:26:08
            [time] => 21:18:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 21:18:00
        )

    [2] => stdClass Object
        (
            [rank] => 0
            [ID] => 1143
            [run_id] => 58
            [user] => kuzmych@ucu.edu.ua
            [first_name] => Артем
            [last_name] => Кузьмич
            [user_id] => 613
            [date] => 2016-11-05 09:26:08
            [time] => 21:25:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 21:25:00
        )

    [3] => stdClass Object
        (
            [rank] => 0
            [ID] => 2478
            [run_id] => 131
            [user] => nazarp06@gmail.com
            [first_name] => Назар
            [last_name] => Полевий
            [user_id] => 650
            [date] => 2017-03-18 16:25:20
            [time] => 21:25:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 21:25:00
        )

    [4] => stdClass Object
        (
            [rank] => 0
            [ID] => 1005
            [run_id] => 52
            [user] => 3dma77@gmail.com
            [first_name] => Дмитро
            [last_name] => Зарихта
            [user_id] => 531
            [date] => 2016-10-22 09:26:40
            [time] => 22:26:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 5
            [personal_best] => 22:26:00
        )

    [5] => stdClass Object
        (
            [rank] => 0
            [ID] => 2203
            [run_id] => 117
            [user] => pslavik77@gmail.com
            [first_name] => Ярослав
            [last_name] => Пастух
            [user_id] => 862
            [date] => 2017-02-21 22:36:21
            [time] => 24:11:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 24:11:00
        )

    [6] => stdClass Object
        (
            [rank] => 0
            [ID] => 3033
            [run_id] => 153
            [user] => mad.taras@gmail.com
            [first_name] => Тарас
            [last_name] => Мазуркевич
            [user_id] => 821
            [date] => 2017-04-15 21:00:46
            [time] => 27:38:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 27:38:00
        )

    [7] => stdClass Object
        (
            [rank] => 0
            [ID] => 904
            [run_id] => 46
            [user] => Nikolai Lawrence
            [first_name] => Nikolai
            [last_name] => Lawrence
            [user_id] => 468
            [date] => 2016-10-15 07:53:58
            [time] => 28:21:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => PSI Panthers Cross Country Team
            [club_link] => https://runday.org/?post_type=runday_club&p=24884
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 28:21:00
        )

    [8] => stdClass Object
        (
            [rank] => 0
            [ID] => 905
            [run_id] => 46
            [user] => mr.boss.senator@mail.ru
            [first_name] => Антон
            [last_name] => Митрофанов
            [user_id] => 310
            [date] => 2016-10-15 07:53:58
            [time] => 28:29:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 28:29:00
        )

)
Місце Ім’я Час Локація
1 Роман Хохич 18:14:00 Труханів Острів, Київ
2 Святослав Гніздовський 21:18:00 Стрийський парк
3 Артем Кузьмич 21:25:00 Стрийський парк
4 Назар Полевий 21:25:00 Стрийський парк
5 Дмитро Зарихта 22:26:00 Тернопіль: Набережна ставу
6 Ярослав Пастух 24:11:00 Тернопіль: Набережна ставу
7 Тарас Мазуркевич 27:38:00 Стрийський парк
8 Nikolai Lawrence 28:21:00 Труханів Острів, Київ
9 Антон Митрофанов 28:29:00 Труханів Острів, Київ

Дівчата

SELECT 
		result.event_place as rank, 
		result.ID, 
		run.ID as run_id, 
		user.display_name as user, 
		first_name.meta_value as first_name, 
		last_name.meta_value as last_name, 
		user.ID as user_id, 
		run.date as date, 
		result.time as time, 
		
		location_post.post_title as location_title, 
		location_post.guid as location_link, 
		location_post.ID as location_id,

		club_post.post_title as club_title,
		club_post.guid as club_link,

		volunteer.volunteered as volunteered,
		is_only_volunteered.value as is_only_volunteered,
		result.volunteered as is_volunteered,
		role.title as volunteer_position,

		runner.runs as runs,

		personal_best.value as personal_best

		FROM (SELECT res1.ID, max(res1.run_id) as run_id, res1.user_id, res1.event_place, res1.time, volunteered, volunteer_position
			FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 15
			            AND datediff(now(), meta_value) / 365.25 < 20
					)
				AND user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_sex'
			            AND meta_value = '2'
					)
				) AS res1
			INNER JOIN (
				SELECT user_id, min(time) as time
	            FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 15
			            AND datediff(now(), meta_value) / 365.25 < 20
					)
				AND user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_sex'
			            AND meta_value = '2'
					)
				) AS res3
	            GROUP BY user_id
				) as res2
			ON (res2.user_id = res1.user_id AND res1.time = res2.time)
			GROUP BY user_id
		) as result
		
		LEFT JOIN wp_runday_run as run
		ON result.run_id = run.ID
		
		LEFT JOIN wp_posts as location_post
		ON run.location_id = location_post.ID
		
		LEFT JOIN wp_users as user
		ON result.user_id = user.ID
		
		LEFT JOIN wp_usermeta as first_name
		ON first_name.user_id = user.ID
	    AND first_name.meta_key = 'first_name'
		
		LEFT JOIN wp_usermeta as last_name
		ON last_name.user_id = user.ID
	    AND last_name.meta_key = 'last_name'
		
		LEFT JOIN wp_usermeta as club
		ON club.user_id = user.ID
	    AND club.meta_key = 'club'
		
		LEFT JOIN wp_posts as club_post
		ON club.meta_value = club_post.post_name
		AND club.meta_value != ''
		AND club_post.post_type = 'runday_club'

		LEFT JOIN (
			SELECT user_id, MIN(volunteered) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as is_only_volunteered
		ON is_only_volunteered.user_id = user.ID

		LEFT JOIN (
			SELECT user_id, MIN(time) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as personal_best
		ON personal_best.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, SUM(volunteered) as volunteered
			FROM (
	            SELECT user_id, MAX(volunteered) AS volunteered
				FROM wp_runday_result
				GROUP BY run_id, user_id) as volunteered_per_run
			GROUP BY user_id
			) as volunteer
		ON volunteer.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, count(*) as runs
			FROM (
	            SELECT user_id
				FROM wp_runday_result
				WHERE volunteered = 0) as only_runs
			GROUP BY user_id
			) as runner
		ON runner.user_id = user.ID

		LEFT JOIN wp_runday_volunteer_positions  as role
		ON result.volunteer_position = role.ID

		WHERE 1 = 1
		 ORDER BY  time ASC, volunteered DESCArray
(
    [0] => stdClass Object
        (
            [rank] => 0
            [ID] => 1697
            [run_id] => 89
            [user] => m_tym@ukr.net
            [first_name] => Mariia
            [last_name] => Tymoshchuk
            [user_id] => 697
            [date] => 2016-12-31 11:47:21
            [time] => 21:47:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 21:47:00
        )

    [1] => stdClass Object
        (
            [rank] => 0
            [ID] => 2546
            [run_id] => 134
            [user] => lbabiy@softserveinc.com
            [first_name] => Людмила
            [last_name] => Бабій
            [user_id] => 672
            [date] => 2017-03-25 23:57:24
            [time] => 24:28:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 5
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 24:28:00
        )

    [2] => stdClass Object
        (
            [rank] => 0
            [ID] => 860
            [run_id] => 44
            [user] => Katerina Schmidt
            [first_name] => Katerina
            [last_name] => Schmidt
            [user_id] => 464
            [date] => 2016-10-08 09:04:10
            [time] => 24:41:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => PSI Panthers Cross Country Team
            [club_link] => https://runday.org/?post_type=runday_club&p=24884
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 24:41:00
        )

    [3] => stdClass Object
        (
            [rank] => 0
            [ID] => 900
            [run_id] => 46
            [user] => Zoya Schmidt
            [first_name] => Zoya
            [last_name] => Schmidt
            [user_id] => 463
            [date] => 2016-10-15 07:53:58
            [time] => 25:06:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => PSI Panthers Cross Country Team
            [club_link] => https://runday.org/?post_type=runday_club&p=24884
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 25:06:00
        )

    [4] => stdClass Object
        (
            [rank] => 0
            [ID] => 903
            [run_id] => 46
            [user] => Anna Bugay
            [first_name] => Anna
            [last_name] => Bugay
            [user_id] => 469
            [date] => 2016-10-15 07:53:58
            [time] => 27:31:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => PSI Panthers Cross Country Team
            [club_link] => https://runday.org/?post_type=runday_club&p=24884
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 27:31:00
        )

    [5] => stdClass Object
        (
            [rank] => 0
            [ID] => 1772
            [run_id] => 90
            [user] => anna171e@gmail.com
            [first_name] => Анна
            [last_name] => Євстратьєва
            [user_id] => 759
            [date] => 2016-12-31 11:55:01
            [time] => 28:45:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 28:45:00
        )

    [6] => stdClass Object
        (
            [rank] => 0
            [ID] => 872
            [run_id] => 44
            [user] => Jessica Cairns
            [first_name] => Jessica
            [last_name] => Cairns
            [user_id] => 470
            [date] => 2016-10-08 09:04:10
            [time] => 28:46:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => PSI Panthers Cross Country Team
            [club_link] => https://runday.org/?post_type=runday_club&p=24884
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 28:46:00
        )

    [7] => stdClass Object
        (
            [rank] => 0
            [ID] => 2828
            [run_id] => 142
            [user] => MK1589@yandex.ua
            [first_name] => Марина
            [last_name] => Ковальова
            [user_id] => 900
            [date] => 2017-04-01 11:57:35
            [time] => 34:53:00
            [location_title] => Одеса: Парк Шевченка
            [location_link] => https://runday.org/?post_type=runday_location&p=25771
            [location_id] => 25771
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 34:53:00
        )

    [8] => stdClass Object
        (
            [rank] => 0
            [ID] => 641
            [run_id] => 47
            [user] => sofi0207@gmail.com
            [first_name] => Софія
            [last_name] => Данильчак
            [user_id] => 396
            [date] => 2016-10-15 08:02:51
            [time] => 59:59:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 2
            [is_only_volunteered] => 1
            [is_volunteered] => 1
            [volunteer_position] => Tokens
            [runs] => 
            [personal_best] => 59:59:00
        )

)
Місце Ім’я Час Локація
1 Mariia Tymoshchuk 21:47:00 Труханів Острів, Київ
2 Людмила Бабій 24:28:00 Стрийський парк
3 Katerina Schmidt 24:41:00 Труханів Острів, Київ
4 Zoya Schmidt 25:06:00 Труханів Острів, Київ
5 Anna Bugay 27:31:00 Труханів Острів, Київ
6 Анна Євстратьєва 28:45:00 Стрийський парк
7 Jessica Cairns 28:46:00 Труханів Острів, Київ
8 Марина Ковальова 34:53:00 Одеса: Парк Шевченка

20-24.

Топ – 10

SELECT 
		result.event_place as rank, 
		result.ID, 
		run.ID as run_id, 
		user.display_name as user, 
		first_name.meta_value as first_name, 
		last_name.meta_value as last_name, 
		user.ID as user_id, 
		run.date as date, 
		result.time as time, 
		
		location_post.post_title as location_title, 
		location_post.guid as location_link, 
		location_post.ID as location_id,

		club_post.post_title as club_title,
		club_post.guid as club_link,

		volunteer.volunteered as volunteered,
		is_only_volunteered.value as is_only_volunteered,
		result.volunteered as is_volunteered,
		role.title as volunteer_position,

		runner.runs as runs,

		personal_best.value as personal_best

		FROM (SELECT res1.ID, max(res1.run_id) as run_id, res1.user_id, res1.event_place, res1.time, volunteered, volunteer_position
			FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 20
			            AND datediff(now(), meta_value) / 365.25 < 25
					)
				
				) AS res1
			INNER JOIN (
				SELECT user_id, min(time) as time
	            FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 20
			            AND datediff(now(), meta_value) / 365.25 < 25
					)
				
				) AS res3
	            GROUP BY user_id
				) as res2
			ON (res2.user_id = res1.user_id AND res1.time = res2.time)
			GROUP BY user_id
		) as result
		
		LEFT JOIN wp_runday_run as run
		ON result.run_id = run.ID
		
		LEFT JOIN wp_posts as location_post
		ON run.location_id = location_post.ID
		
		LEFT JOIN wp_users as user
		ON result.user_id = user.ID
		
		LEFT JOIN wp_usermeta as first_name
		ON first_name.user_id = user.ID
	    AND first_name.meta_key = 'first_name'
		
		LEFT JOIN wp_usermeta as last_name
		ON last_name.user_id = user.ID
	    AND last_name.meta_key = 'last_name'
		
		LEFT JOIN wp_usermeta as club
		ON club.user_id = user.ID
	    AND club.meta_key = 'club'
		
		LEFT JOIN wp_posts as club_post
		ON club.meta_value = club_post.post_name
		AND club.meta_value != ''
		AND club_post.post_type = 'runday_club'

		LEFT JOIN (
			SELECT user_id, MIN(volunteered) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as is_only_volunteered
		ON is_only_volunteered.user_id = user.ID

		LEFT JOIN (
			SELECT user_id, MIN(time) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as personal_best
		ON personal_best.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, SUM(volunteered) as volunteered
			FROM (
	            SELECT user_id, MAX(volunteered) AS volunteered
				FROM wp_runday_result
				GROUP BY run_id, user_id) as volunteered_per_run
			GROUP BY user_id
			) as volunteer
		ON volunteer.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, count(*) as runs
			FROM (
	            SELECT user_id
				FROM wp_runday_result
				WHERE volunteered = 0) as only_runs
			GROUP BY user_id
			) as runner
		ON runner.user_id = user.ID

		LEFT JOIN wp_runday_volunteer_positions  as role
		ON result.volunteer_position = role.ID

		WHERE 1 = 1
		 ORDER BY  time ASC, volunteered DESCArray
(
    [0] => stdClass Object
        (
            [rank] => 0
            [ID] => 2872
            [run_id] => 145
            [user] => vitaliypolischuk9@gmail.com
            [first_name] => Віталій
            [last_name] => Поліщук
            [user_id] => 1032
            [date] => 2017-04-08 08:01:31
            [time] => 17:07:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 17:07:00
        )

    [1] => stdClass Object
        (
            [rank] => 0
            [ID] => 4186
            [run_id] => 229
            [user] => oleg_butkovskii@ukr.net
            [first_name] => Олег
            [last_name] => Бутковський
            [user_id] => 807
            [date] => 2017-07-01 09:42:27
            [time] => 17:17:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 2
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 15
            [personal_best] => 17:17:00
        )

    [2] => stdClass Object
        (
            [rank] => 0
            [ID] => 3910
            [run_id] => 207
            [user] => vvv.melnychuk@gmail.com
            [first_name] => Vitaliy
            [last_name] => Melnychuk
            [user_id] => 575
            [date] => 2017-06-10 10:28:14
            [time] => 17:33:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 18
            [personal_best] => 17:33:00
        )

    [3] => stdClass Object
        (
            [rank] => 0
            [ID] => 1264
            [run_id] => 65
            [user] => svitlanaillya@gmail.com
            [first_name] => Ілля
            [last_name] => Павлюк
            [user_id] => 502
            [date] => 2016-11-12 11:09:02
            [time] => 17:50:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 17:50:00
        )

    [4] => stdClass Object
        (
            [rank] => 0
            [ID] => 2339
            [run_id] => 125
            [user] => horodchuk@gmail.com
            [first_name] => Тарас
            [last_name] => Городчук
            [user_id] => 631
            [date] => 2017-03-04 21:55:09
            [time] => 18:16:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 18:16:00
        )

    [5] => stdClass Object
        (
            [rank] => 0
            [ID] => 1248
            [run_id] => 64
            [user] => andrew.white.kuts@gmail.com
            [first_name] => Andrew
            [last_name] => Kuts
            [user_id] => 633
            [date] => 2016-11-12 09:31:27
            [time] => 18:23:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 18:23:00
        )

    [6] => stdClass Object
        (
            [rank] => 0
            [ID] => 936
            [run_id] => 48
            [user] => horror150196@gmail.com
            [first_name] => Олександр
            [last_name] => Оршак
            [user_id] => 533
            [date] => 2016-10-15 10:04:16
            [time] => 19:11:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 19:11:00
        )

    [7] => stdClass Object
        (
            [rank] => 0
            [ID] => 1105
            [run_id] => 57
            [user] => nonst0penrgy@gmail.com
            [first_name] => Юра
            [last_name] => Киричинський
            [user_id] => 475
            [date] => 2016-10-29 09:56:09
            [time] => 19:12:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 7
            [personal_best] => 19:12:00
        )

    [8] => stdClass Object
        (
            [rank] => 0
            [ID] => 915
            [run_id] => 47
            [user] => lewkoo@gmail.com
            [first_name] => Левко
            [last_name] => Іванчук
            [user_id] => 267
            [date] => 2016-10-15 08:02:51
            [time] => 19:42:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 3
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 8
            [personal_best] => 19:42:00
        )

    [9] => stdClass Object
        (
            [rank] => 0
            [ID] => 3282
            [run_id] => 172
            [user] => eliemrad321@hotmail.con
            [first_name] =>  Илья
            [last_name] => Мрад
            [user_id] => 1243
            [date] => 2017-05-06 08:24:06
            [time] => 20:03:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 5
            [personal_best] => 20:03:00
        )

    [10] => stdClass Object
        (
            [rank] => 0
            [ID] => 1270
            [run_id] => 65
            [user] => severko.f@gmail.com
            [first_name] => Северин
            [last_name] => Фернеза
            [user_id] => 516
            [date] => 2016-11-12 11:09:02
            [time] => 20:37:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 20:37:00
        )

    [11] => stdClass Object
        (
            [rank] => 0
            [ID] => 3924
            [run_id] => 208
            [user] => g0n4er@gmail.com
            [first_name] => Михайло
            [last_name] => Афанасьєв
            [user_id] => 1515
            [date] => 2017-06-10 09:27:12
            [time] => 20:50:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 20:50:00
        )

    [12] => stdClass Object
        (
            [rank] => 0
            [ID] => 2994
            [run_id] => 152
            [user] => ihor_bank@mail.ru
            [first_name] => Ihor
            [last_name] => Bankov
            [user_id] => 1194
            [date] => 2017-04-15 20:51:11
            [time] => 20:58:00
            [location_title] => Одеса: Парк Шевченка
            [location_link] => https://runday.org/?post_type=runday_location&p=25771
            [location_id] => 25771
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 20:58:00
        )

    [13] => stdClass Object
        (
            [rank] => 0
            [ID] => 3459
            [run_id] => 181
            [user] => para1bellum@gmail.com
            [first_name] => Ксенія
            [last_name] => Ніколаєнко
            [user_id] => 408
            [date] => 2017-05-13 20:06:01
            [time] => 21:23:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 21:23:00
        )

    [14] => stdClass Object
        (
            [rank] => 0
            [ID] => 1276
            [run_id] => 65
            [user] => barandmytro@gmail.com
            [first_name] => Дмитро
            [last_name] => Баран
            [user_id] => 425
            [date] => 2016-11-12 11:09:02
            [time] => 21:28:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 30
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 21:28:00
        )

    [15] => stdClass Object
        (
            [rank] => 0
            [ID] => 651
            [run_id] => 38
            [user] => ivan.kopych@gmail.com
            [first_name] => Іван
            [last_name] => Копич
            [user_id] => 308
            [date] => 2016-10-01 09:22:43
            [time] => 21:39:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 21:39:00
        )

    [16] => stdClass Object
        (
            [rank] => 0
            [ID] => 1752
            [run_id] => 90
            [user] => igora740@ukr.net
            [first_name] => Ігор 
            [last_name] => Хвалібота
            [user_id] => 795
            [date] => 2016-12-31 11:55:01
            [time] => 21:48:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 21:48:00
        )

    [17] => stdClass Object
        (
            [rank] => 0
            [ID] => 1278
            [run_id] => 65
            [user] => olehmarko@gmail.com
            [first_name] => Олег
            [last_name] => Марко
            [user_id] => 629
            [date] => 2016-11-12 11:09:02
            [time] => 21:59:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 21:59:00
        )

    [18] => stdClass Object
        (
            [rank] => 0
            [ID] => 2357
            [run_id] => 125
            [user] => ivanbakun.new@gmail.com
            [first_name] => Ivan
            [last_name] => Bakun
            [user_id] => 598
            [date] => 2017-03-04 21:55:09
            [time] => 22:35:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 2
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 22:35:00
        )

    [19] => stdClass Object
        (
            [rank] => 0
            [ID] => 187
            [run_id] => 15
            [user] => skelja.hm@gmail.com
            [first_name] => Михайло
            [last_name] => Гордич
            [user_id] => 181
            [date] => 2016-08-13 09:16:59
            [time] => 22:41:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 22:41:00
        )

    [20] => stdClass Object
        (
            [rank] => 0
            [ID] => 1115
            [run_id] => 57
            [user] => dii2010@mail.ru
            [first_name] => Іван
            [last_name] => Дубас
            [user_id] => 591
            [date] => 2016-10-29 09:56:09
            [time] => 23:00:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 23:00:00
        )

    [21] => stdClass Object
        (
            [rank] => 0
            [ID] => 1117
            [run_id] => 57
            [user] => ozarkiv.ihor@gmail.com
            [first_name] => Ігор
            [last_name] => Озарків
            [user_id] => 569
            [date] => 2016-10-29 09:56:09
            [time] => 23:10:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 23:10:00
        )

    [22] => stdClass Object
        (
            [rank] => 0
            [ID] => 1146
            [run_id] => 58
            [user] => mikola.vovchko@gmail.com
            [first_name] => Микола
            [last_name] => Вовчко
            [user_id] => 609
            [date] => 2016-11-05 09:26:08
            [time] => 23:17:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 23:17:00
        )

    [23] => stdClass Object
        (
            [rank] => 0
            [ID] => 3864
            [run_id] => 205
            [user] => victoria-demnuk12345@ukr.net
            [first_name] => Віка
            [last_name] => Демник
            [user_id] => 577
            [date] => 2017-06-10 09:30:43
            [time] => 23:26:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 23:26:00
        )

    [24] => stdClass Object
        (
            [rank] => 0
            [ID] => 309
            [run_id] => 21
            [user] => volodyaduma@gmail.com
            [first_name] => Володимир
            [last_name] => Дума
            [user_id] => 265
            [date] => 2016-08-27 11:00:48
            [time] => 23:37:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 23:37:00
        )

    [25] => stdClass Object
        (
            [rank] => 0
            [ID] => 2540
            [run_id] => 134
            [user] => misha.shastin@gmail.com
            [first_name] => Михайло
            [last_name] => Шастін
            [user_id] => 825
            [date] => 2017-03-25 23:57:24
            [time] => 23:40:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 11
            [personal_best] => 23:40:00
        )

    [26] => stdClass Object
        (
            [rank] => 0
            [ID] => 4192
            [run_id] => 229
            [user] => sviatoslav.kricak@gmail.com
            [first_name] => Святослав
            [last_name] => Кріцак
            [user_id] => 1607
            [date] => 2017-07-01 09:42:27
            [time] => 24:00:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 24:00:00
        )

    [27] => stdClass Object
        (
            [rank] => 0
            [ID] => 2543
            [run_id] => 134
            [user] => crazygeorgiy@gmail.com
            [first_name] => Юрій
            [last_name] => Репецький
            [user_id] => 1029
            [date] => 2017-03-25 23:57:24
            [time] => 24:19:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 24:19:00
        )

    [28] => stdClass Object
        (
            [rank] => 0
            [ID] => 2544
            [run_id] => 134
            [user] => julkohon@yahoo.com
            [first_name] => Юліан
            [last_name] => Гончар
            [user_id] => 847
            [date] => 2017-03-25 23:57:24
            [time] => 24:21:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 24:21:00
        )

    [29] => stdClass Object
        (
            [rank] => 0
            [ID] => 950
            [run_id] => 48
            [user] => nadiya.mytnyk@gmail.com
            [first_name] => Надія
            [last_name] => Митник
            [user_id] => 512
            [date] => 2016-10-15 10:04:16
            [time] => 24:30:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 24:30:00
        )

    [30] => stdClass Object
        (
            [rank] => 0
            [ID] => 2490
            [run_id] => 131
            [user] => iramatviiv@ukr.net
            [first_name] => Ірина
            [last_name] => Матвіїв
            [user_id] => 814
            [date] => 2017-03-18 16:25:20
            [time] => 24:35:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 5
            [personal_best] => 24:35:00
        )

    [31] => stdClass Object
        (
            [rank] => 0
            [ID] => 3603
            [run_id] => 190
            [user] => artem1209@gmail.com
            [first_name] => Артем
            [last_name] => Воробець
            [user_id] => 1411
            [date] => 2017-05-20 17:55:38
            [time] => 24:47:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 24:47:00
        )

    [32] => stdClass Object
        (
            [rank] => 0
            [ID] => 955
            [run_id] => 48
            [user] => taras.korzhak96@gmail.com
            [first_name] => Тарас
            [last_name] => Коржак
            [user_id] => 527
            [date] => 2016-10-15 10:04:16
            [time] => 24:54:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 24:54:00
        )

    [33] => stdClass Object
        (
            [rank] => 0
            [ID] => 4443
            [run_id] => 246
            [user] => orestkarapinka@gmail.com
            [first_name] => Orest
            [last_name] => Karapinka
            [user_id] => 1659
            [date] => 2017-07-15 15:14:58
            [time] => 25:09:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 25:09:00
        )

    [34] => stdClass Object
        (
            [rank] => 0
            [ID] => 784
            [run_id] => 43
            [user] => bevzenko.stanislav@gmail.com
            [first_name] => Станислав
            [last_name] => Бевзенко
            [user_id] => 433
            [date] => 2016-10-01 12:24:56
            [time] => 25:32:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 25:32:00
        )

    [35] => stdClass Object
        (
            [rank] => 0
            [ID] => 3687
            [run_id] => 196
            [user] => vyn.natalie@gmail.com
            [first_name] => Наталя
            [last_name] => Винярчук
            [user_id] => 164
            [date] => 2017-05-27 19:56:10
            [time] => 25:37:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 25:37:00
        )

    [36] => stdClass Object
        (
            [rank] => 0
            [ID] => 1151
            [run_id] => 58
            [user] => hrustuamakota@gmail.com
            [first_name] => Христя
            [last_name] => Макота
            [user_id] => 247
            [date] => 2016-11-05 09:26:08
            [time] => 25:44:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 28
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 7
            [personal_best] => 25:44:00
        )

    [37] => stdClass Object
        (
            [rank] => 0
            [ID] => 2370
            [run_id] => 125
            [user] => jrsuper24@gmail.com
            [first_name] => jovan
            [last_name] => Gethers Rizza
            [user_id] => 625
            [date] => 2017-03-04 21:55:09
            [time] => 25:56:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 25:56:00
        )

    [38] => stdClass Object
        (
            [rank] => 0
            [ID] => 630
            [run_id] => 37
            [user] => sizov.mykhailo@gmail.com
            [first_name] => Міша
            [last_name] => Сізов
            [user_id] => 262
            [date] => 2016-09-24 09:22:59
            [time] => 26:02:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 26:02:00
        )

    [39] => stdClass Object
        (
            [rank] => 0
            [ID] => 398
            [run_id] => 28
            [user] => olhadorosh@gmail.com
            [first_name] => Ольга
            [last_name] => Дорош
            [user_id] => 227
            [date] => 2016-09-10 13:55:40
            [time] => 26:06:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 4
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 26:06:00
        )

    [40] => stdClass Object
        (
            [rank] => 0
            [ID] => 984
            [run_id] => 50
            [user] => stanislava.bayko@perfectial.com
            [first_name] => Стася
            [last_name] => Байко
            [user_id] => 554
            [date] => 2016-10-22 09:19:19
            [time] => 26:17:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 26:17:00
        )

    [41] => stdClass Object
        (
            [rank] => 0
            [ID] => 410
            [run_id] => 29
            [user] => olga_grischuk@mail.ru
            [first_name] => Ольга
            [last_name] => Грищук
            [user_id] => 329
            [date] => 2016-09-10 14:00:39
            [time] => 26:43:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 26:43:00
        )

    [42] => stdClass Object
        (
            [rank] => 6
            [ID] => 53
            [run_id] => 8
            [user] => L-burtchenja@mail.ru
            [first_name] => Лілія
            [last_name] => Бурченя
            [user_id] => 60
            [date] => 2016-07-30 07:58:33
            [time] => 26:49:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 26:49:00
        )

    [43] => stdClass Object
        (
            [rank] => 7
            [ID] => 54
            [run_id] => 8
            [user] => yuliia.yehorova@gmail.com
            [first_name] => Yuliia
            [last_name] => Yehorova
            [user_id] => 88
            [date] => 2016-07-30 07:58:33
            [time] => 26:51:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 26:51:00
        )

    [44] => stdClass Object
        (
            [rank] => 0
            [ID] => 2373
            [run_id] => 125
            [user] => jbiganich@gmail.com
            [first_name] => Юля
            [last_name] => Біганич
            [user_id] => 888
            [date] => 2017-03-04 21:55:09
            [time] => 27:23:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 27:23:00
        )

    [45] => stdClass Object
        (
            [rank] => 0
            [ID] => 659
            [run_id] => 38
            [user] => wrongig@gmail.com
            [first_name] => Катерина
            [last_name] => Кривда
            [user_id] => 426
            [date] => 2016-10-01 09:22:43
            [time] => 29:03:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 29:03:00
        )

    [46] => stdClass Object
        (
            [rank] => 0
            [ID] => 202
            [run_id] => 15
            [user] => timea.sehedi@gmail.com
            [first_name] => Тімея
            [last_name] => Сегеді
            [user_id] => 168
            [date] => 2016-08-13 09:16:59
            [time] => 29:07:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 29:07:00
        )

    [47] => stdClass Object
        (
            [rank] => 0
            [ID] => 3666
            [run_id] => 194
            [user] => artemremchuk@gmail.com
            [first_name] => Artem
            [last_name] => Remchuk
            [user_id] => 1456
            [date] => 2017-05-27 15:09:38
            [time] => 29:39:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 29:39:00
        )

    [48] => stdClass Object
        (
            [rank] => 0
            [ID] => 303
            [run_id] => 20
            [user] => andrewoshchudlyak@gmail.com
            [first_name] => Андрій
            [last_name] => Ощудляк
            [user_id] => 222
            [date] => 2016-08-20 10:00:01
            [time] => 29:40:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 29:40:00
        )

    [49] => stdClass Object
        (
            [rank] => 0
            [ID] => 3006
            [run_id] => 152
            [user] => mini_karini@mail.ru
            [first_name] => Karina
            [last_name] => Kosogor
            [user_id] => 1198
            [date] => 2017-04-15 20:51:11
            [time] => 29:53:00
            [location_title] => Одеса: Парк Шевченка
            [location_link] => https://runday.org/?post_type=runday_location&p=25771
            [location_id] => 25771
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 29:53:00
        )

    [50] => stdClass Object
        (
            [rank] => 0
            [ID] => 2812
            [run_id] => 142
            [user] => sloniki303@mail.ru
            [first_name] => Mariia
            [last_name] => Rosokhata
            [user_id] => 1066
            [date] => 2017-04-01 11:57:35
            [time] => 29:58:00
            [location_title] => Одеса: Парк Шевченка
            [location_link] => https://runday.org/?post_type=runday_location&p=25771
            [location_id] => 25771
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 29:58:00
        )

    [51] => stdClass Object
        (
            [rank] => 0
            [ID] => 2378
            [run_id] => 125
            [user] => chudanovanya@gmail.com
            [first_name] => Анна
            [last_name] => Чуданова
            [user_id] => 886
            [date] => 2017-03-04 21:55:09
            [time] => 30:19:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 2
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 30:19:00
        )

    [52] => stdClass Object
        (
            [rank] => 0
            [ID] => 887
            [run_id] => 45
            [user] => martahryvniak@gmail.com
            [first_name] => Марта
            [last_name] => Гривняк
            [user_id] => 477
            [date] => 2016-10-08 09:13:00
            [time] => 30:42:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 2
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 30:42:00
        )

    [53] => stdClass Object
        (
            [rank] => 0
            [ID] => 2332
            [run_id] => 124
            [user] => yurakorolyshyn@gmail.com
            [first_name] => Юрій
            [last_name] => Королишин
            [user_id] => 904
            [date] => 2017-03-04 21:43:31
            [time] => 31:01:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 31:01:00
        )

    [54] => stdClass Object
        (
            [rank] => 0
            [ID] => 637
            [run_id] => 37
            [user] => o.k.karlysha@gmail.com
            [first_name] => Ольга
            [last_name] => Карлова
            [user_id] => 352
            [date] => 2016-09-24 09:22:59
            [time] => 31:03:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 31:03:00
        )

    [55] => stdClass Object
        (
            [rank] => 0
            [ID] => 347
            [run_id] => 24
            [user] => bos1-9@mail.ru
            [first_name] => Юлія
            [last_name] => Слободянюк
            [user_id] => 327
            [date] => 2016-09-03 08:15:36
            [time] => 31:21:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 31:21:00
        )

    [56] => stdClass Object
        (
            [rank] => 10
            [ID] => 68
            [run_id] => 9
            [user] => grechkovskyi@gmail.com
            [first_name] => Євген
            [last_name] => Гречківський
            [user_id] => 152
            [date] => 2016-08-06 08:45:46
            [time] => 33:12:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 33:12:00
        )

    [57] => stdClass Object
        (
            [rank] => 0
            [ID] => 2173
            [run_id] => 115
            [user] => olya_yaremchuk21@mail.ru
            [first_name] => Оля
            [last_name] => Яремчук
            [user_id] => 860
            [date] => 2017-02-18 23:09:16
            [time] => 35:05:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 35:05:00
        )

    [58] => stdClass Object
        (
            [rank] => 0
            [ID] => 2174
            [run_id] => 115
            [user] => m.kopanchuk@gmail.com
            [first_name] => Марк
            [last_name] => Копанчук
            [user_id] => 859
            [date] => 2017-02-18 23:09:16
            [time] => 35:07:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 35:07:00
        )

    [59] => stdClass Object
        (
            [rank] => 0
            [ID] => 1729
            [run_id] => 89
            [user] => masunka@bigmir.net
            [first_name] => Марія
            [last_name] => Москалець
            [user_id] => 297
            [date] => 2016-12-31 11:47:21
            [time] => 35:37:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 35:37:00
        )

    [60] => stdClass Object
        (
            [rank] => 0
            [ID] => 1874
            [run_id] => 96
            [user] => mk_ultra@list.ru
            [first_name] => Катерина
            [last_name] => Яковенко
            [user_id] => 813
            [date] => 2017-01-14 18:26:32
            [time] => 36:56:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 36:56:00
        )

    [61] => stdClass Object
        (
            [rank] => 0
            [ID] => 1852
            [run_id] => 223
            [user] => parshynanna@gmail.com
            [first_name] => Анна
            [last_name] => Паршина
            [user_id] => 689
            [date] => 2017-06-24 12:48:00
            [time] => 59:59:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 12
            [is_only_volunteered] => 1
            [is_volunteered] => 1
            [volunteer_position] => Timekeeper
            [runs] => 
            [personal_best] => 59:59:00
        )

    [62] => stdClass Object
        (
            [rank] => 0
            [ID] => 767
            [run_id] => 43
            [user] => tania.karpenko.1993@gmail.com
            [first_name] => Tetyana
            [last_name] => Karpenko
            [user_id] => 451
            [date] => 2016-10-01 12:24:56
            [time] => 59:59:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 2
            [is_only_volunteered] => 1
            [is_volunteered] => 1
            [volunteer_position] => Scanning
            [runs] => 
            [personal_best] => 59:59:00
        )

    [63] => stdClass Object
        (
            [rank] => 0
            [ID] => 477
            [run_id] => 21
            [user] => pool2010@ukr.net
            [first_name] => Костянтин
            [last_name] => Коляда
            [user_id] => 281
            [date] => 2016-08-27 11:00:48
            [time] => 59:59:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 1
            [is_volunteered] => 1
            [volunteer_position] => Scanning
            [runs] => 
            [personal_best] => 59:59:00
        )

    [64] => stdClass Object
        (
            [rank] => 0
            [ID] => 2383
            [run_id] => 126
            [user] => jasyr.nana@gmail.com
            [first_name] => Анастасія
            [last_name] => Ясир
            [user_id] => 675
            [date] => 2017-03-11 21:34:33
            [time] => 59:59:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 1
            [is_volunteered] => 1
            [volunteer_position] => Tokens
            [runs] => 
            [personal_best] => 59:59:00
        )

)
Місце Ім’я Час Локація
1 Віталій Поліщук 17:07:00 Труханів Острів, Київ
2 Олег Бутковський 17:17:00 Тернопіль: Набережна ставу
3 Vitaliy Melnychuk 17:33:00 Тернопіль: Набережна ставу
4 Ілля Павлюк 17:50:00 Стрийський парк
5 Тарас Городчук 18:16:00 Стрийський парк
6 Andrew Kuts 18:23:00 Труханів Острів, Київ
7 Олександр Оршак 19:11:00 Тернопіль: Набережна ставу
8 Юра Киричинський 19:12:00 Стрийський парк
9 Левко Іванчук 19:42:00 Стрийський парк
10 Илья Мрад 20:03:00 Стрийський парк

Чоловіки

SELECT 
		result.event_place as rank, 
		result.ID, 
		run.ID as run_id, 
		user.display_name as user, 
		first_name.meta_value as first_name, 
		last_name.meta_value as last_name, 
		user.ID as user_id, 
		run.date as date, 
		result.time as time, 
		
		location_post.post_title as location_title, 
		location_post.guid as location_link, 
		location_post.ID as location_id,

		club_post.post_title as club_title,
		club_post.guid as club_link,

		volunteer.volunteered as volunteered,
		is_only_volunteered.value as is_only_volunteered,
		result.volunteered as is_volunteered,
		role.title as volunteer_position,

		runner.runs as runs,

		personal_best.value as personal_best

		FROM (SELECT res1.ID, max(res1.run_id) as run_id, res1.user_id, res1.event_place, res1.time, volunteered, volunteer_position
			FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 20
			            AND datediff(now(), meta_value) / 365.25 < 25
					)
				AND user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_sex'
			            AND meta_value = '1'
					)
				) AS res1
			INNER JOIN (
				SELECT user_id, min(time) as time
	            FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 20
			            AND datediff(now(), meta_value) / 365.25 < 25
					)
				AND user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_sex'
			            AND meta_value = '1'
					)
				) AS res3
	            GROUP BY user_id
				) as res2
			ON (res2.user_id = res1.user_id AND res1.time = res2.time)
			GROUP BY user_id
		) as result
		
		LEFT JOIN wp_runday_run as run
		ON result.run_id = run.ID
		
		LEFT JOIN wp_posts as location_post
		ON run.location_id = location_post.ID
		
		LEFT JOIN wp_users as user
		ON result.user_id = user.ID
		
		LEFT JOIN wp_usermeta as first_name
		ON first_name.user_id = user.ID
	    AND first_name.meta_key = 'first_name'
		
		LEFT JOIN wp_usermeta as last_name
		ON last_name.user_id = user.ID
	    AND last_name.meta_key = 'last_name'
		
		LEFT JOIN wp_usermeta as club
		ON club.user_id = user.ID
	    AND club.meta_key = 'club'
		
		LEFT JOIN wp_posts as club_post
		ON club.meta_value = club_post.post_name
		AND club.meta_value != ''
		AND club_post.post_type = 'runday_club'

		LEFT JOIN (
			SELECT user_id, MIN(volunteered) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as is_only_volunteered
		ON is_only_volunteered.user_id = user.ID

		LEFT JOIN (
			SELECT user_id, MIN(time) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as personal_best
		ON personal_best.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, SUM(volunteered) as volunteered
			FROM (
	            SELECT user_id, MAX(volunteered) AS volunteered
				FROM wp_runday_result
				GROUP BY run_id, user_id) as volunteered_per_run
			GROUP BY user_id
			) as volunteer
		ON volunteer.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, count(*) as runs
			FROM (
	            SELECT user_id
				FROM wp_runday_result
				WHERE volunteered = 0) as only_runs
			GROUP BY user_id
			) as runner
		ON runner.user_id = user.ID

		LEFT JOIN wp_runday_volunteer_positions  as role
		ON result.volunteer_position = role.ID

		WHERE 1 = 1
		 ORDER BY  time ASC, volunteered DESCArray
(
    [0] => stdClass Object
        (
            [rank] => 0
            [ID] => 2872
            [run_id] => 145
            [user] => vitaliypolischuk9@gmail.com
            [first_name] => Віталій
            [last_name] => Поліщук
            [user_id] => 1032
            [date] => 2017-04-08 08:01:31
            [time] => 17:07:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 17:07:00
        )

    [1] => stdClass Object
        (
            [rank] => 0
            [ID] => 4186
            [run_id] => 229
            [user] => oleg_butkovskii@ukr.net
            [first_name] => Олег
            [last_name] => Бутковський
            [user_id] => 807
            [date] => 2017-07-01 09:42:27
            [time] => 17:17:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 2
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 15
            [personal_best] => 17:17:00
        )

    [2] => stdClass Object
        (
            [rank] => 0
            [ID] => 3910
            [run_id] => 207
            [user] => vvv.melnychuk@gmail.com
            [first_name] => Vitaliy
            [last_name] => Melnychuk
            [user_id] => 575
            [date] => 2017-06-10 10:28:14
            [time] => 17:33:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 18
            [personal_best] => 17:33:00
        )

    [3] => stdClass Object
        (
            [rank] => 0
            [ID] => 1264
            [run_id] => 65
            [user] => svitlanaillya@gmail.com
            [first_name] => Ілля
            [last_name] => Павлюк
            [user_id] => 502
            [date] => 2016-11-12 11:09:02
            [time] => 17:50:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 17:50:00
        )

    [4] => stdClass Object
        (
            [rank] => 0
            [ID] => 2339
            [run_id] => 125
            [user] => horodchuk@gmail.com
            [first_name] => Тарас
            [last_name] => Городчук
            [user_id] => 631
            [date] => 2017-03-04 21:55:09
            [time] => 18:16:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 18:16:00
        )

    [5] => stdClass Object
        (
            [rank] => 0
            [ID] => 1248
            [run_id] => 64
            [user] => andrew.white.kuts@gmail.com
            [first_name] => Andrew
            [last_name] => Kuts
            [user_id] => 633
            [date] => 2016-11-12 09:31:27
            [time] => 18:23:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 18:23:00
        )

    [6] => stdClass Object
        (
            [rank] => 0
            [ID] => 936
            [run_id] => 48
            [user] => horror150196@gmail.com
            [first_name] => Олександр
            [last_name] => Оршак
            [user_id] => 533
            [date] => 2016-10-15 10:04:16
            [time] => 19:11:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 19:11:00
        )

    [7] => stdClass Object
        (
            [rank] => 0
            [ID] => 1105
            [run_id] => 57
            [user] => nonst0penrgy@gmail.com
            [first_name] => Юра
            [last_name] => Киричинський
            [user_id] => 475
            [date] => 2016-10-29 09:56:09
            [time] => 19:12:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 7
            [personal_best] => 19:12:00
        )

    [8] => stdClass Object
        (
            [rank] => 0
            [ID] => 915
            [run_id] => 47
            [user] => lewkoo@gmail.com
            [first_name] => Левко
            [last_name] => Іванчук
            [user_id] => 267
            [date] => 2016-10-15 08:02:51
            [time] => 19:42:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 3
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 8
            [personal_best] => 19:42:00
        )

    [9] => stdClass Object
        (
            [rank] => 0
            [ID] => 3282
            [run_id] => 172
            [user] => eliemrad321@hotmail.con
            [first_name] =>  Илья
            [last_name] => Мрад
            [user_id] => 1243
            [date] => 2017-05-06 08:24:06
            [time] => 20:03:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 5
            [personal_best] => 20:03:00
        )

    [10] => stdClass Object
        (
            [rank] => 0
            [ID] => 1270
            [run_id] => 65
            [user] => severko.f@gmail.com
            [first_name] => Северин
            [last_name] => Фернеза
            [user_id] => 516
            [date] => 2016-11-12 11:09:02
            [time] => 20:37:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 20:37:00
        )

    [11] => stdClass Object
        (
            [rank] => 0
            [ID] => 3924
            [run_id] => 208
            [user] => g0n4er@gmail.com
            [first_name] => Михайло
            [last_name] => Афанасьєв
            [user_id] => 1515
            [date] => 2017-06-10 09:27:12
            [time] => 20:50:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 20:50:00
        )

    [12] => stdClass Object
        (
            [rank] => 0
            [ID] => 2994
            [run_id] => 152
            [user] => ihor_bank@mail.ru
            [first_name] => Ihor
            [last_name] => Bankov
            [user_id] => 1194
            [date] => 2017-04-15 20:51:11
            [time] => 20:58:00
            [location_title] => Одеса: Парк Шевченка
            [location_link] => https://runday.org/?post_type=runday_location&p=25771
            [location_id] => 25771
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 20:58:00
        )

    [13] => stdClass Object
        (
            [rank] => 0
            [ID] => 1276
            [run_id] => 65
            [user] => barandmytro@gmail.com
            [first_name] => Дмитро
            [last_name] => Баран
            [user_id] => 425
            [date] => 2016-11-12 11:09:02
            [time] => 21:28:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 30
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 21:28:00
        )

    [14] => stdClass Object
        (
            [rank] => 0
            [ID] => 651
            [run_id] => 38
            [user] => ivan.kopych@gmail.com
            [first_name] => Іван
            [last_name] => Копич
            [user_id] => 308
            [date] => 2016-10-01 09:22:43
            [time] => 21:39:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 21:39:00
        )

    [15] => stdClass Object
        (
            [rank] => 0
            [ID] => 1752
            [run_id] => 90
            [user] => igora740@ukr.net
            [first_name] => Ігор 
            [last_name] => Хвалібота
            [user_id] => 795
            [date] => 2016-12-31 11:55:01
            [time] => 21:48:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 21:48:00
        )

    [16] => stdClass Object
        (
            [rank] => 0
            [ID] => 1278
            [run_id] => 65
            [user] => olehmarko@gmail.com
            [first_name] => Олег
            [last_name] => Марко
            [user_id] => 629
            [date] => 2016-11-12 11:09:02
            [time] => 21:59:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 21:59:00
        )

    [17] => stdClass Object
        (
            [rank] => 0
            [ID] => 2357
            [run_id] => 125
            [user] => ivanbakun.new@gmail.com
            [first_name] => Ivan
            [last_name] => Bakun
            [user_id] => 598
            [date] => 2017-03-04 21:55:09
            [time] => 22:35:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 2
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 22:35:00
        )

    [18] => stdClass Object
        (
            [rank] => 0
            [ID] => 187
            [run_id] => 15
            [user] => skelja.hm@gmail.com
            [first_name] => Михайло
            [last_name] => Гордич
            [user_id] => 181
            [date] => 2016-08-13 09:16:59
            [time] => 22:41:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 22:41:00
        )

    [19] => stdClass Object
        (
            [rank] => 0
            [ID] => 1115
            [run_id] => 57
            [user] => dii2010@mail.ru
            [first_name] => Іван
            [last_name] => Дубас
            [user_id] => 591
            [date] => 2016-10-29 09:56:09
            [time] => 23:00:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 23:00:00
        )

    [20] => stdClass Object
        (
            [rank] => 0
            [ID] => 1117
            [run_id] => 57
            [user] => ozarkiv.ihor@gmail.com
            [first_name] => Ігор
            [last_name] => Озарків
            [user_id] => 569
            [date] => 2016-10-29 09:56:09
            [time] => 23:10:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 23:10:00
        )

    [21] => stdClass Object
        (
            [rank] => 0
            [ID] => 1146
            [run_id] => 58
            [user] => mikola.vovchko@gmail.com
            [first_name] => Микола
            [last_name] => Вовчко
            [user_id] => 609
            [date] => 2016-11-05 09:26:08
            [time] => 23:17:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 23:17:00
        )

    [22] => stdClass Object
        (
            [rank] => 0
            [ID] => 309
            [run_id] => 21
            [user] => volodyaduma@gmail.com
            [first_name] => Володимир
            [last_name] => Дума
            [user_id] => 265
            [date] => 2016-08-27 11:00:48
            [time] => 23:37:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 23:37:00
        )

    [23] => stdClass Object
        (
            [rank] => 0
            [ID] => 2540
            [run_id] => 134
            [user] => misha.shastin@gmail.com
            [first_name] => Михайло
            [last_name] => Шастін
            [user_id] => 825
            [date] => 2017-03-25 23:57:24
            [time] => 23:40:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 11
            [personal_best] => 23:40:00
        )

    [24] => stdClass Object
        (
            [rank] => 0
            [ID] => 4192
            [run_id] => 229
            [user] => sviatoslav.kricak@gmail.com
            [first_name] => Святослав
            [last_name] => Кріцак
            [user_id] => 1607
            [date] => 2017-07-01 09:42:27
            [time] => 24:00:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 24:00:00
        )

    [25] => stdClass Object
        (
            [rank] => 0
            [ID] => 2543
            [run_id] => 134
            [user] => crazygeorgiy@gmail.com
            [first_name] => Юрій
            [last_name] => Репецький
            [user_id] => 1029
            [date] => 2017-03-25 23:57:24
            [time] => 24:19:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 24:19:00
        )

    [26] => stdClass Object
        (
            [rank] => 0
            [ID] => 2544
            [run_id] => 134
            [user] => julkohon@yahoo.com
            [first_name] => Юліан
            [last_name] => Гончар
            [user_id] => 847
            [date] => 2017-03-25 23:57:24
            [time] => 24:21:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 24:21:00
        )

    [27] => stdClass Object
        (
            [rank] => 0
            [ID] => 3603
            [run_id] => 190
            [user] => artem1209@gmail.com
            [first_name] => Артем
            [last_name] => Воробець
            [user_id] => 1411
            [date] => 2017-05-20 17:55:38
            [time] => 24:47:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 24:47:00
        )

    [28] => stdClass Object
        (
            [rank] => 0
            [ID] => 955
            [run_id] => 48
            [user] => taras.korzhak96@gmail.com
            [first_name] => Тарас
            [last_name] => Коржак
            [user_id] => 527
            [date] => 2016-10-15 10:04:16
            [time] => 24:54:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 24:54:00
        )

    [29] => stdClass Object
        (
            [rank] => 0
            [ID] => 4443
            [run_id] => 246
            [user] => orestkarapinka@gmail.com
            [first_name] => Orest
            [last_name] => Karapinka
            [user_id] => 1659
            [date] => 2017-07-15 15:14:58
            [time] => 25:09:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 25:09:00
        )

    [30] => stdClass Object
        (
            [rank] => 0
            [ID] => 784
            [run_id] => 43
            [user] => bevzenko.stanislav@gmail.com
            [first_name] => Станислав
            [last_name] => Бевзенко
            [user_id] => 433
            [date] => 2016-10-01 12:24:56
            [time] => 25:32:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 25:32:00
        )

    [31] => stdClass Object
        (
            [rank] => 0
            [ID] => 2370
            [run_id] => 125
            [user] => jrsuper24@gmail.com
            [first_name] => jovan
            [last_name] => Gethers Rizza
            [user_id] => 625
            [date] => 2017-03-04 21:55:09
            [time] => 25:56:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 25:56:00
        )

    [32] => stdClass Object
        (
            [rank] => 0
            [ID] => 630
            [run_id] => 37
            [user] => sizov.mykhailo@gmail.com
            [first_name] => Міша
            [last_name] => Сізов
            [user_id] => 262
            [date] => 2016-09-24 09:22:59
            [time] => 26:02:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 26:02:00
        )

    [33] => stdClass Object
        (
            [rank] => 0
            [ID] => 3666
            [run_id] => 194
            [user] => artemremchuk@gmail.com
            [first_name] => Artem
            [last_name] => Remchuk
            [user_id] => 1456
            [date] => 2017-05-27 15:09:38
            [time] => 29:39:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 29:39:00
        )

    [34] => stdClass Object
        (
            [rank] => 0
            [ID] => 303
            [run_id] => 20
            [user] => andrewoshchudlyak@gmail.com
            [first_name] => Андрій
            [last_name] => Ощудляк
            [user_id] => 222
            [date] => 2016-08-20 10:00:01
            [time] => 29:40:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 29:40:00
        )

    [35] => stdClass Object
        (
            [rank] => 0
            [ID] => 2332
            [run_id] => 124
            [user] => yurakorolyshyn@gmail.com
            [first_name] => Юрій
            [last_name] => Королишин
            [user_id] => 904
            [date] => 2017-03-04 21:43:31
            [time] => 31:01:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 31:01:00
        )

    [36] => stdClass Object
        (
            [rank] => 10
            [ID] => 68
            [run_id] => 9
            [user] => grechkovskyi@gmail.com
            [first_name] => Євген
            [last_name] => Гречківський
            [user_id] => 152
            [date] => 2016-08-06 08:45:46
            [time] => 33:12:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 33:12:00
        )

    [37] => stdClass Object
        (
            [rank] => 0
            [ID] => 2174
            [run_id] => 115
            [user] => m.kopanchuk@gmail.com
            [first_name] => Марк
            [last_name] => Копанчук
            [user_id] => 859
            [date] => 2017-02-18 23:09:16
            [time] => 35:07:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 35:07:00
        )

    [38] => stdClass Object
        (
            [rank] => 0
            [ID] => 477
            [run_id] => 21
            [user] => pool2010@ukr.net
            [first_name] => Костянтин
            [last_name] => Коляда
            [user_id] => 281
            [date] => 2016-08-27 11:00:48
            [time] => 59:59:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 1
            [is_volunteered] => 1
            [volunteer_position] => Scanning
            [runs] => 
            [personal_best] => 59:59:00
        )

)
Місце Ім’я Час Локація
1 Віталій Поліщук 17:07:00 Труханів Острів, Київ
2 Олег Бутковський 17:17:00 Тернопіль: Набережна ставу
3 Vitaliy Melnychuk 17:33:00 Тернопіль: Набережна ставу
4 Ілля Павлюк 17:50:00 Стрийський парк
5 Тарас Городчук 18:16:00 Стрийський парк
6 Andrew Kuts 18:23:00 Труханів Острів, Київ
7 Олександр Оршак 19:11:00 Тернопіль: Набережна ставу
8 Юра Киричинський 19:12:00 Стрийський парк
9 Левко Іванчук 19:42:00 Стрийський парк
10 Илья Мрад 20:03:00 Стрийський парк

Жінки

SELECT 
		result.event_place as rank, 
		result.ID, 
		run.ID as run_id, 
		user.display_name as user, 
		first_name.meta_value as first_name, 
		last_name.meta_value as last_name, 
		user.ID as user_id, 
		run.date as date, 
		result.time as time, 
		
		location_post.post_title as location_title, 
		location_post.guid as location_link, 
		location_post.ID as location_id,

		club_post.post_title as club_title,
		club_post.guid as club_link,

		volunteer.volunteered as volunteered,
		is_only_volunteered.value as is_only_volunteered,
		result.volunteered as is_volunteered,
		role.title as volunteer_position,

		runner.runs as runs,

		personal_best.value as personal_best

		FROM (SELECT res1.ID, max(res1.run_id) as run_id, res1.user_id, res1.event_place, res1.time, volunteered, volunteer_position
			FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 20
			            AND datediff(now(), meta_value) / 365.25 < 25
					)
				AND user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_sex'
			            AND meta_value = '2'
					)
				) AS res1
			INNER JOIN (
				SELECT user_id, min(time) as time
	            FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 20
			            AND datediff(now(), meta_value) / 365.25 < 25
					)
				AND user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_sex'
			            AND meta_value = '2'
					)
				) AS res3
	            GROUP BY user_id
				) as res2
			ON (res2.user_id = res1.user_id AND res1.time = res2.time)
			GROUP BY user_id
		) as result
		
		LEFT JOIN wp_runday_run as run
		ON result.run_id = run.ID
		
		LEFT JOIN wp_posts as location_post
		ON run.location_id = location_post.ID
		
		LEFT JOIN wp_users as user
		ON result.user_id = user.ID
		
		LEFT JOIN wp_usermeta as first_name
		ON first_name.user_id = user.ID
	    AND first_name.meta_key = 'first_name'
		
		LEFT JOIN wp_usermeta as last_name
		ON last_name.user_id = user.ID
	    AND last_name.meta_key = 'last_name'
		
		LEFT JOIN wp_usermeta as club
		ON club.user_id = user.ID
	    AND club.meta_key = 'club'
		
		LEFT JOIN wp_posts as club_post
		ON club.meta_value = club_post.post_name
		AND club.meta_value != ''
		AND club_post.post_type = 'runday_club'

		LEFT JOIN (
			SELECT user_id, MIN(volunteered) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as is_only_volunteered
		ON is_only_volunteered.user_id = user.ID

		LEFT JOIN (
			SELECT user_id, MIN(time) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as personal_best
		ON personal_best.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, SUM(volunteered) as volunteered
			FROM (
	            SELECT user_id, MAX(volunteered) AS volunteered
				FROM wp_runday_result
				GROUP BY run_id, user_id) as volunteered_per_run
			GROUP BY user_id
			) as volunteer
		ON volunteer.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, count(*) as runs
			FROM (
	            SELECT user_id
				FROM wp_runday_result
				WHERE volunteered = 0) as only_runs
			GROUP BY user_id
			) as runner
		ON runner.user_id = user.ID

		LEFT JOIN wp_runday_volunteer_positions  as role
		ON result.volunteer_position = role.ID

		WHERE 1 = 1
		 ORDER BY  time ASC, volunteered DESCArray
(
    [0] => stdClass Object
        (
            [rank] => 0
            [ID] => 3459
            [run_id] => 181
            [user] => para1bellum@gmail.com
            [first_name] => Ксенія
            [last_name] => Ніколаєнко
            [user_id] => 408
            [date] => 2017-05-13 20:06:01
            [time] => 21:23:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 21:23:00
        )

    [1] => stdClass Object
        (
            [rank] => 0
            [ID] => 3864
            [run_id] => 205
            [user] => victoria-demnuk12345@ukr.net
            [first_name] => Віка
            [last_name] => Демник
            [user_id] => 577
            [date] => 2017-06-10 09:30:43
            [time] => 23:26:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 23:26:00
        )

    [2] => stdClass Object
        (
            [rank] => 0
            [ID] => 950
            [run_id] => 48
            [user] => nadiya.mytnyk@gmail.com
            [first_name] => Надія
            [last_name] => Митник
            [user_id] => 512
            [date] => 2016-10-15 10:04:16
            [time] => 24:30:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 24:30:00
        )

    [3] => stdClass Object
        (
            [rank] => 0
            [ID] => 2490
            [run_id] => 131
            [user] => iramatviiv@ukr.net
            [first_name] => Ірина
            [last_name] => Матвіїв
            [user_id] => 814
            [date] => 2017-03-18 16:25:20
            [time] => 24:35:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 5
            [personal_best] => 24:35:00
        )

    [4] => stdClass Object
        (
            [rank] => 0
            [ID] => 3687
            [run_id] => 196
            [user] => vyn.natalie@gmail.com
            [first_name] => Наталя
            [last_name] => Винярчук
            [user_id] => 164
            [date] => 2017-05-27 19:56:10
            [time] => 25:37:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 25:37:00
        )

    [5] => stdClass Object
        (
            [rank] => 0
            [ID] => 1151
            [run_id] => 58
            [user] => hrustuamakota@gmail.com
            [first_name] => Христя
            [last_name] => Макота
            [user_id] => 247
            [date] => 2016-11-05 09:26:08
            [time] => 25:44:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 28
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 7
            [personal_best] => 25:44:00
        )

    [6] => stdClass Object
        (
            [rank] => 0
            [ID] => 398
            [run_id] => 28
            [user] => olhadorosh@gmail.com
            [first_name] => Ольга
            [last_name] => Дорош
            [user_id] => 227
            [date] => 2016-09-10 13:55:40
            [time] => 26:06:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 4
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 26:06:00
        )

    [7] => stdClass Object
        (
            [rank] => 0
            [ID] => 984
            [run_id] => 50
            [user] => stanislava.bayko@perfectial.com
            [first_name] => Стася
            [last_name] => Байко
            [user_id] => 554
            [date] => 2016-10-22 09:19:19
            [time] => 26:17:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 26:17:00
        )

    [8] => stdClass Object
        (
            [rank] => 0
            [ID] => 410
            [run_id] => 29
            [user] => olga_grischuk@mail.ru
            [first_name] => Ольга
            [last_name] => Грищук
            [user_id] => 329
            [date] => 2016-09-10 14:00:39
            [time] => 26:43:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 26:43:00
        )

    [9] => stdClass Object
        (
            [rank] => 6
            [ID] => 53
            [run_id] => 8
            [user] => L-burtchenja@mail.ru
            [first_name] => Лілія
            [last_name] => Бурченя
            [user_id] => 60
            [date] => 2016-07-30 07:58:33
            [time] => 26:49:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 26:49:00
        )

    [10] => stdClass Object
        (
            [rank] => 7
            [ID] => 54
            [run_id] => 8
            [user] => yuliia.yehorova@gmail.com
            [first_name] => Yuliia
            [last_name] => Yehorova
            [user_id] => 88
            [date] => 2016-07-30 07:58:33
            [time] => 26:51:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 26:51:00
        )

    [11] => stdClass Object
        (
            [rank] => 0
            [ID] => 2373
            [run_id] => 125
            [user] => jbiganich@gmail.com
            [first_name] => Юля
            [last_name] => Біганич
            [user_id] => 888
            [date] => 2017-03-04 21:55:09
            [time] => 27:23:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 27:23:00
        )

    [12] => stdClass Object
        (
            [rank] => 0
            [ID] => 659
            [run_id] => 38
            [user] => wrongig@gmail.com
            [first_name] => Катерина
            [last_name] => Кривда
            [user_id] => 426
            [date] => 2016-10-01 09:22:43
            [time] => 29:03:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 29:03:00
        )

    [13] => stdClass Object
        (
            [rank] => 0
            [ID] => 202
            [run_id] => 15
            [user] => timea.sehedi@gmail.com
            [first_name] => Тімея
            [last_name] => Сегеді
            [user_id] => 168
            [date] => 2016-08-13 09:16:59
            [time] => 29:07:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 29:07:00
        )

    [14] => stdClass Object
        (
            [rank] => 0
            [ID] => 3006
            [run_id] => 152
            [user] => mini_karini@mail.ru
            [first_name] => Karina
            [last_name] => Kosogor
            [user_id] => 1198
            [date] => 2017-04-15 20:51:11
            [time] => 29:53:00
            [location_title] => Одеса: Парк Шевченка
            [location_link] => https://runday.org/?post_type=runday_location&p=25771
            [location_id] => 25771
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 29:53:00
        )

    [15] => stdClass Object
        (
            [rank] => 0
            [ID] => 2812
            [run_id] => 142
            [user] => sloniki303@mail.ru
            [first_name] => Mariia
            [last_name] => Rosokhata
            [user_id] => 1066
            [date] => 2017-04-01 11:57:35
            [time] => 29:58:00
            [location_title] => Одеса: Парк Шевченка
            [location_link] => https://runday.org/?post_type=runday_location&p=25771
            [location_id] => 25771
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 29:58:00
        )

    [16] => stdClass Object
        (
            [rank] => 0
            [ID] => 2378
            [run_id] => 125
            [user] => chudanovanya@gmail.com
            [first_name] => Анна
            [last_name] => Чуданова
            [user_id] => 886
            [date] => 2017-03-04 21:55:09
            [time] => 30:19:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 2
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 30:19:00
        )

    [17] => stdClass Object
        (
            [rank] => 0
            [ID] => 887
            [run_id] => 45
            [user] => martahryvniak@gmail.com
            [first_name] => Марта
            [last_name] => Гривняк
            [user_id] => 477
            [date] => 2016-10-08 09:13:00
            [time] => 30:42:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 2
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 30:42:00
        )

    [18] => stdClass Object
        (
            [rank] => 0
            [ID] => 637
            [run_id] => 37
            [user] => o.k.karlysha@gmail.com
            [first_name] => Ольга
            [last_name] => Карлова
            [user_id] => 352
            [date] => 2016-09-24 09:22:59
            [time] => 31:03:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 31:03:00
        )

    [19] => stdClass Object
        (
            [rank] => 0
            [ID] => 347
            [run_id] => 24
            [user] => bos1-9@mail.ru
            [first_name] => Юлія
            [last_name] => Слободянюк
            [user_id] => 327
            [date] => 2016-09-03 08:15:36
            [time] => 31:21:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 31:21:00
        )

    [20] => stdClass Object
        (
            [rank] => 0
            [ID] => 2173
            [run_id] => 115
            [user] => olya_yaremchuk21@mail.ru
            [first_name] => Оля
            [last_name] => Яремчук
            [user_id] => 860
            [date] => 2017-02-18 23:09:16
            [time] => 35:05:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 35:05:00
        )

    [21] => stdClass Object
        (
            [rank] => 0
            [ID] => 1729
            [run_id] => 89
            [user] => masunka@bigmir.net
            [first_name] => Марія
            [last_name] => Москалець
            [user_id] => 297
            [date] => 2016-12-31 11:47:21
            [time] => 35:37:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 35:37:00
        )

    [22] => stdClass Object
        (
            [rank] => 0
            [ID] => 1874
            [run_id] => 96
            [user] => mk_ultra@list.ru
            [first_name] => Катерина
            [last_name] => Яковенко
            [user_id] => 813
            [date] => 2017-01-14 18:26:32
            [time] => 36:56:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 36:56:00
        )

    [23] => stdClass Object
        (
            [rank] => 0
            [ID] => 1852
            [run_id] => 223
            [user] => parshynanna@gmail.com
            [first_name] => Анна
            [last_name] => Паршина
            [user_id] => 689
            [date] => 2017-06-24 12:48:00
            [time] => 59:59:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 12
            [is_only_volunteered] => 1
            [is_volunteered] => 1
            [volunteer_position] => Timekeeper
            [runs] => 
            [personal_best] => 59:59:00
        )

    [24] => stdClass Object
        (
            [rank] => 0
            [ID] => 767
            [run_id] => 43
            [user] => tania.karpenko.1993@gmail.com
            [first_name] => Tetyana
            [last_name] => Karpenko
            [user_id] => 451
            [date] => 2016-10-01 12:24:56
            [time] => 59:59:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 2
            [is_only_volunteered] => 1
            [is_volunteered] => 1
            [volunteer_position] => Scanning
            [runs] => 
            [personal_best] => 59:59:00
        )

    [25] => stdClass Object
        (
            [rank] => 0
            [ID] => 2383
            [run_id] => 126
            [user] => jasyr.nana@gmail.com
            [first_name] => Анастасія
            [last_name] => Ясир
            [user_id] => 675
            [date] => 2017-03-11 21:34:33
            [time] => 59:59:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 1
            [is_volunteered] => 1
            [volunteer_position] => Tokens
            [runs] => 
            [personal_best] => 59:59:00
        )

)
Місце Ім’я Час Локація
1 Ксенія Ніколаєнко 21:23:00 Стрийський парк
2 Віка Демник 23:26:00 Стрийський парк
3 Надія Митник 24:30:00 Тернопіль: Набережна ставу
4 Ірина Матвіїв 24:35:00 Стрийський парк
5 Наталя Винярчук 25:37:00 Стрийський парк
6 Христя Макота 25:44:00 Стрийський парк
7 Ольга Дорош 26:06:00 Стрийський парк
8 Стася Байко 26:17:00 Стрийський парк
9 Ольга Грищук 26:43:00 Труханів Острів, Київ
10 Лілія Бурченя 26:49:00 Труханів Острів, Київ

25-29.

Топ – 10

SELECT 
		result.event_place as rank, 
		result.ID, 
		run.ID as run_id, 
		user.display_name as user, 
		first_name.meta_value as first_name, 
		last_name.meta_value as last_name, 
		user.ID as user_id, 
		run.date as date, 
		result.time as time, 
		
		location_post.post_title as location_title, 
		location_post.guid as location_link, 
		location_post.ID as location_id,

		club_post.post_title as club_title,
		club_post.guid as club_link,

		volunteer.volunteered as volunteered,
		is_only_volunteered.value as is_only_volunteered,
		result.volunteered as is_volunteered,
		role.title as volunteer_position,

		runner.runs as runs,

		personal_best.value as personal_best

		FROM (SELECT res1.ID, max(res1.run_id) as run_id, res1.user_id, res1.event_place, res1.time, volunteered, volunteer_position
			FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 25
			            AND datediff(now(), meta_value) / 365.25 < 30
					)
				
				) AS res1
			INNER JOIN (
				SELECT user_id, min(time) as time
	            FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 25
			            AND datediff(now(), meta_value) / 365.25 < 30
					)
				
				) AS res3
	            GROUP BY user_id
				) as res2
			ON (res2.user_id = res1.user_id AND res1.time = res2.time)
			GROUP BY user_id
		) as result
		
		LEFT JOIN wp_runday_run as run
		ON result.run_id = run.ID
		
		LEFT JOIN wp_posts as location_post
		ON run.location_id = location_post.ID
		
		LEFT JOIN wp_users as user
		ON result.user_id = user.ID
		
		LEFT JOIN wp_usermeta as first_name
		ON first_name.user_id = user.ID
	    AND first_name.meta_key = 'first_name'
		
		LEFT JOIN wp_usermeta as last_name
		ON last_name.user_id = user.ID
	    AND last_name.meta_key = 'last_name'
		
		LEFT JOIN wp_usermeta as club
		ON club.user_id = user.ID
	    AND club.meta_key = 'club'
		
		LEFT JOIN wp_posts as club_post
		ON club.meta_value = club_post.post_name
		AND club.meta_value != ''
		AND club_post.post_type = 'runday_club'

		LEFT JOIN (
			SELECT user_id, MIN(volunteered) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as is_only_volunteered
		ON is_only_volunteered.user_id = user.ID

		LEFT JOIN (
			SELECT user_id, MIN(time) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as personal_best
		ON personal_best.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, SUM(volunteered) as volunteered
			FROM (
	            SELECT user_id, MAX(volunteered) AS volunteered
				FROM wp_runday_result
				GROUP BY run_id, user_id) as volunteered_per_run
			GROUP BY user_id
			) as volunteer
		ON volunteer.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, count(*) as runs
			FROM (
	            SELECT user_id
				FROM wp_runday_result
				WHERE volunteered = 0) as only_runs
			GROUP BY user_id
			) as runner
		ON runner.user_id = user.ID

		LEFT JOIN wp_runday_volunteer_positions  as role
		ON result.volunteer_position = role.ID

		WHERE 1 = 1
		 ORDER BY  time ASC, volunteered DESCArray
(
    [0] => stdClass Object
        (
            [rank] => 0
            [ID] => 287
            [run_id] => 20
            [user] => rostik777@gmail.com
            [first_name] => Ростислав
            [last_name] => Карташов
            [user_id] => 255
            [date] => 2016-08-20 10:00:01
            [time] => 16:18:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 28
            [personal_best] => 16:18:00
        )

    [1] => stdClass Object
        (
            [rank] => 0
            [ID] => 3944
            [run_id] => 210
            [user] => vadim.bankov@gmail.com
            [first_name] => Вадим
            [last_name] => Банков
            [user_id] => 1209
            [date] => 2017-06-17 14:17:43
            [time] => 16:35:00
            [location_title] => Одеса: Парк Шевченка
            [location_link] => https://runday.org/?post_type=runday_location&p=25771
            [location_id] => 25771
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 11
            [personal_best] => 16:35:00
        )

    [2] => stdClass Object
        (
            [rank] => 0
            [ID] => 1629
            [run_id] => 87
            [user] => martyniuk2002@ukr.net
            [first_name] => Андрій
            [last_name] => Мартинюк
            [user_id] => 728
            [date] => 2016-12-24 10:51:38
            [time] => 17:49:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 17:49:00
        )

    [3] => stdClass Object
        (
            [rank] => 0
            [ID] => 2338
            [run_id] => 125
            [user] => orient.ck@gmail.com
            [first_name] => Artem
            [last_name] => Slotin
            [user_id] => 379
            [date] => 2017-03-04 21:55:09
            [time] => 18:04:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 18:04:00
        )

    [4] => stdClass Object
        (
            [rank] => 0
            [ID] => 935
            [run_id] => 48
            [user] => advokat@ukr.net
            [first_name] => микола
            [last_name] => трачук
            [user_id] => 535
            [date] => 2016-10-15 10:04:16
            [time] => 19:10:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 19:10:00
        )

    [5] => stdClass Object
        (
            [rank] => 0
            [ID] => 4164
            [run_id] => 227
            [user] => sergulio_1989@ukr.net
            [first_name] => Сергій
            [last_name] => Сорокін
            [user_id] => 1273
            [date] => 2017-07-01 12:06:08
            [time] => 19:18:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 19:18:00
        )

    [6] => stdClass Object
        (
            [rank] => 0
            [ID] => 1440
            [run_id] => 74
            [user] => fedorovaolen@mail.ru
            [first_name] => Олена
            [last_name] => Федорова
            [user_id] => 540
            [date] => 2016-11-26 13:55:23
            [time] => 19:19:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 6
            [personal_best] => 19:19:00
        )

    [7] => stdClass Object
        (
            [rank] => 0
            [ID] => 289
            [run_id] => 20
            [user] => romchyk005@gmail.com
            [first_name] => Roman
            [last_name] => Shp'yelyk 
            [user_id] => 249
            [date] => 2016-08-20 10:00:01
            [time] => 19:32:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 19:32:00
        )

    [8] => stdClass Object
        (
            [rank] => 0
            [ID] => 937
            [run_id] => 48
            [user] => stepashka_@ukr.net
            [first_name] => Олексій
            [last_name] => Степанов
            [user_id] => 526
            [date] => 2016-10-15 10:04:16
            [time] => 19:34:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 19:34:00
        )

    [9] => stdClass Object
        (
            [rank] => 0
            [ID] => 2394
            [run_id] => 126
            [user] => chernegapetro@gmail.com
            [first_name] => Петро
            [last_name] => Чернега
            [user_id] => 815
            [date] => 2017-03-11 21:34:33
            [time] => 20:09:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 6
            [personal_best] => 20:09:00
        )

    [10] => stdClass Object
        (
            [rank] => 0
            [ID] => 918
            [run_id] => 47
            [user] => khmelovskyi@outlook.com
            [first_name] => Volodymyr
            [last_name] => Khmelovskyi
            [user_id] => 478
            [date] => 2016-10-15 08:02:51
            [time] => 20:19:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 8
            [personal_best] => 20:19:00
        )

    [11] => stdClass Object
        (
            [rank] => 0
            [ID] => 938
            [run_id] => 48
            [user] => serhiyjj@gmail.com
            [first_name] => Сергій
            [last_name] => Кучирка
            [user_id] => 514
            [date] => 2016-10-15 10:04:16
            [time] => 20:23:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 20:23:00
        )

    [12] => stdClass Object
        (
            [rank] => 0
            [ID] => 1693
            [run_id] => 89
            [user] => dkcompany@bk.ru
            [first_name] => Виталик 
            [last_name] => Пляциков
            [user_id] => 774
            [date] => 2016-12-31 11:47:21
            [time] => 20:26:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 20:26:00
        )

    [13] => stdClass Object
        (
            [rank] => 0
            [ID] => 388
            [run_id] => 28
            [user] => mobiaks@mail.ua
            [first_name] => Петро 
            [last_name] => Гук
            [user_id] => 361
            [date] => 2016-09-10 13:55:40
            [time] => 20:33:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 20:33:00
        )

    [14] => stdClass Object
        (
            [rank] => 0
            [ID] => 1109
            [run_id] => 57
            [user] => Leon4444@i.ua
            [first_name] => Леонід
            [last_name] => Шамарін
            [user_id] => 350
            [date] => 2016-10-29 09:56:09
            [time] => 20:34:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 20:34:00
        )

    [15] => stdClass Object
        (
            [rank] => 0
            [ID] => 2773
            [run_id] => 142
            [user] => iva@biir.dk
            [first_name] => Ievgenii
            [last_name] => Vasylenko
            [user_id] => 1103
            [date] => 2017-04-01 11:57:35
            [time] => 20:46:00
            [location_title] => Одеса: Парк Шевченка
            [location_link] => https://runday.org/?post_type=runday_location&p=25771
            [location_id] => 25771
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 5
            [personal_best] => 20:46:00
        )

    [16] => stdClass Object
        (
            [rank] => 0
            [ID] => 351
            [run_id] => 25
            [user] => andrew-pb@mail.ru
            [first_name] => Андрій
            [last_name] => Максимук
            [user_id] => 309
            [date] => 2016-09-03 08:20:44
            [time] => 21:17:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 21:17:00
        )

    [17] => stdClass Object
        (
            [rank] => 0
            [ID] => 183
            [run_id] => 15
            [user] => orest.zub@gmail.com
            [first_name] => Orest
            [last_name] => Zub
            [user_id] => 199
            [date] => 2016-08-13 09:16:59
            [time] => 21:24:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 2
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 21:24:00
        )

    [18] => stdClass Object
        (
            [rank] => 0
            [ID] => 1568
            [run_id] => 83
            [user] => trachukiv@gmail.com
            [first_name] => Ігор
            [last_name] => Трачук
            [user_id] => 677
            [date] => 2016-12-17 11:04:53
            [time] => 21:35:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 21:35:00
        )

    [19] => stdClass Object
        (
            [rank] => 0
            [ID] => 2308
            [run_id] => 123
            [user] => crfcrm@ukr.net
            [first_name] => Александр
            [last_name] => Рекало
            [user_id] => 776
            [date] => 2017-03-04 10:08:45
            [time] => 21:37:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 21:37:00
        )

    [20] => stdClass Object
        (
            [rank] => 0
            [ID] => 1277
            [run_id] => 65
            [user] => ishenko-dmitrij@mail.ru
            [first_name] => ДМИТРО
            [last_name] => ІЩЕНКО
            [user_id] => 564
            [date] => 2016-11-12 11:09:02
            [time] => 21:38:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 21:38:00
        )

    [21] => stdClass Object
        (
            [rank] => 0
            [ID] => 1250
            [run_id] => 64
            [user] => alex-kuts@ukr.net
            [first_name] => Олександр
            [last_name] => Куць
            [user_id] => 585
            [date] => 2016-11-12 09:31:27
            [time] => 21:39:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 21:39:00
        )

    [22] => stdClass Object
        (
            [rank] => 0
            [ID] => 2350
            [run_id] => 125
            [user] => nhlynka@gmail.com
            [first_name] => Mykola
            [last_name] => Hlynka
            [user_id] => 906
            [date] => 2017-03-04 21:55:09
            [time] => 21:40:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 21:40:00
        )

    [23] => stdClass Object
        (
            [rank] => 0
            [ID] => 3732
            [run_id] => 199
            [user] => oleg.knol@gmail.com
            [first_name] => Олег
            [last_name] => Кноль
            [user_id] => 524
            [date] => 2017-06-03 11:02:44
            [time] => 21:52:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 3
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 10
            [personal_best] => 21:52:00
        )

    [24] => stdClass Object
        (
            [rank] => 0
            [ID] => 1935
            [run_id] => 101
            [user] => mikeonyshkiv@gmail.com
            [first_name] => Михайло
            [last_name] => Онишків
            [user_id] => 546
            [date] => 2017-01-28 14:14:01
            [time] => 21:54:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 21:54:00
        )

    [25] => stdClass Object
        (
            [rank] => 0
            [ID] => 1174
            [run_id] => 60
            [user] => tyrist.13@gmail.com
            [first_name] => Рома
            [last_name] => Мороз
            [user_id] => 589
            [date] => 2016-11-05 09:35:08
            [time] => 21:56:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => СТК "Легіон"
            [club_link] => https://runday.org/?post_type=runday_club&p=25347
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 21:56:00
        )

    [26] => stdClass Object
        (
            [rank] => 0
            [ID] => 1753
            [run_id] => 90
            [user] => skailer1313@gmail.com
            [first_name] => Олексій
            [last_name] => Зенін
            [user_id] => 796
            [date] => 2016-12-31 11:55:01
            [time] => 21:58:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 21:58:00
        )

    [27] => stdClass Object
        (
            [rank] => 0
            [ID] => 4034
            [run_id] => 218
            [user] => andriy.polevy@gmail.com
            [first_name] => Андрій
            [last_name] => Полевий
            [user_id] => 649
            [date] => 2017-06-24 09:47:19
            [time] => 22:04:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 6
            [personal_best] => 22:04:00
        )

    [28] => stdClass Object
        (
            [rank] => 0
            [ID] => 2355
            [run_id] => 125
            [user] => tetalviv@gmail.com
            [first_name] => Tetiana
            [last_name] => Danyliv
            [user_id] => 830
            [date] => 2017-03-04 21:55:09
            [time] => 22:14:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 8
            [personal_best] => 22:14:00
        )

    [29] => stdClass Object
        (
            [rank] => 0
            [ID] => 403
            [run_id] => 29
            [user] => toras.cn@gmail.com
            [first_name] => Taras
            [last_name] => Lototsky
            [user_id] => 291
            [date] => 2016-09-10 14:00:39
            [time] => 22:19:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 6
            [personal_best] => 22:19:00
        )

    [30] => stdClass Object
        (
            [rank] => 0
            [ID] => 942
            [run_id] => 48
            [user] => Muxayloforest@gmail.com
            [first_name] => Михайло
            [last_name] => Стухляк
            [user_id] => 525
            [date] => 2016-10-15 10:04:16
            [time] => 22:23:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 22:23:00
        )

    [31] => stdClass Object
        (
            [rank] => 0
            [ID] => 776
            [run_id] => 43
            [user] => oleksandrkasheev@gmail.com
            [first_name] => Олександр
            [last_name] => Кащеєв
            [user_id] => 439
            [date] => 2016-10-01 12:24:56
            [time] => 22:27:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 22:27:00
        )

    [32] => stdClass Object
        (
            [rank] => 0
            [ID] => 290
            [run_id] => 20
            [user] => desingalex1989@gmail.com
            [first_name] => Олексій
            [last_name] => Бочаров
            [user_id] => 219
            [date] => 2016-08-20 10:00:01
            [time] => 22:33:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 22:33:00
        )

    [33] => stdClass Object
        (
            [rank] => 0
            [ID] => 2562
            [run_id] => 135
            [user] => flayr@i.ua
            [first_name] => Василь
            [last_name] => Клак
            [user_id] => 829
            [date] => 2017-03-25 00:04:03
            [time] => 22:38:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 5
            [personal_best] => 22:38:00
        )

    [34] => stdClass Object
        (
            [rank] => 0
            [ID] => 777
            [run_id] => 43
            [user] => bogvelik123@gmail.com
            [first_name] => Андрій
            [last_name] => Тишковець
            [user_id] => 385
            [date] => 2016-10-01 12:24:56
            [time] => 22:38:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 22:38:00
        )

    [35] => stdClass Object
        (
            [rank] => 0
            [ID] => 2216
            [run_id] => 118
            [user] => paucaverba@inbox.ru
            [first_name] => Надія
            [last_name] => Чумаченко
            [user_id] => 304
            [date] => 2017-02-25 10:06:51
            [time] => 22:58:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 22:58:00
        )

    [36] => stdClass Object
        (
            [rank] => 0
            [ID] => 1795
            [run_id] => 91
            [user] => y.mishchuk@gmail.com
            [first_name] => Юрій
            [last_name] => Міщук
            [user_id] => 511
            [date] => 2016-12-31 12:07:43
            [time] => 23:08:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 10
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 23:08:00
        )

    [37] => stdClass Object
        (
            [rank] => 0
            [ID] => 4436
            [run_id] => 246
            [user] => vmmedvid@gmail.com
            [first_name] => Володимир
            [last_name] => Медвідь
            [user_id] => 1633
            [date] => 2017-07-15 15:14:58
            [time] => 23:12:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 23:12:00
        )

    [38] => stdClass Object
        (
            [rank] => 0
            [ID] => 3290
            [run_id] => 172
            [user] => arbrix@gmail.com
            [first_name] => Ivan
            [last_name] => Kutuzov
            [user_id] => 668
            [date] => 2017-05-06 08:24:06
            [time] => 23:26:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => SoftServe
            [club_link] => https://runday.org/?post_type=runday_club&p=25168
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 23:26:00
        )

    [39] => stdClass Object
        (
            [rank] => 0
            [ID] => 1940
            [run_id] => 101
            [user] => Oleg.Zarevennyi@gmail.com
            [first_name] => Oleg
            [last_name] => Zarevennyi
            [user_id] => 663
            [date] => 2017-01-28 14:14:01
            [time] => 23:29:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 23:29:00
        )

    [40] => stdClass Object
        (
            [rank] => 0
            [ID] => 518
            [run_id] => 32
            [user] => romanaleks.m@gmail.com
            [first_name] => Роман
            [last_name] => Митрофанов
            [user_id] => 311
            [date] => 2016-09-18 04:20:29
            [time] => 23:30:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 7
            [personal_best] => 23:30:00
        )

    [41] => stdClass Object
        (
            [rank] => 0
            [ID] => 944
            [run_id] => 48
            [user] => karpa.yura@gmail.com
            [first_name] => Yuriy
            [last_name] => Karpa
            [user_id] => 528
            [date] => 2016-10-15 10:04:16
            [time] => 23:30:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 23:30:00
        )

    [42] => stdClass Object
        (
            [rank] => 0
            [ID] => 2362
            [run_id] => 125
            [user] => orest.oleskiv@gmail.com
            [first_name] => Орест
            [last_name] => Олеськів
            [user_id] => 887
            [date] => 2017-03-04 21:55:09
            [time] => 23:31:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 23:31:00
        )

    [43] => stdClass Object
        (
            [rank] => 0
            [ID] => 189
            [run_id] => 15
            [user] => Глеба Володимир
            [first_name] => Володимир
            [last_name] => Глеба
            [user_id] => 2
            [date] => 2016-08-13 09:16:59
            [time] => 23:39:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => Veedoo
            [club_link] => http://runday.org/?post_type=runday_club&p=24647
            [volunteered] => 2
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 23:39:00
        )

    [44] => stdClass Object
        (
            [rank] => 0
            [ID] => 3027
            [run_id] => 153
            [user] => dr.volodymyr.vovk@gmail.com
            [first_name] => Володимир
            [last_name] => Вовк
            [user_id] => 912
            [date] => 2017-04-15 21:00:46
            [time] => 23:48:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 23:48:00
        )

    [45] => stdClass Object
        (
            [rank] => 0
            [ID] => 946
            [run_id] => 48
            [user] => olesiavip@gmail.com
            [first_name] => Олеся
            [last_name] => Чайнюк
            [user_id] => 507
            [date] => 2016-10-15 10:04:16
            [time] => 23:50:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 23:50:00
        )

    [46] => stdClass Object
        (
            [rank] => 0
            [ID] => 190
            [run_id] => 15
            [user] => xDarynka
            [first_name] => Даша
            [last_name] => Сокольникова
            [user_id] => 3
            [date] => 2016-08-13 09:16:59
            [time] => 23:56:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => Veedoo
            [club_link] => http://runday.org/?post_type=runday_club&p=24647
            [volunteered] => 22
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 23:56:00
        )

    [47] => stdClass Object
        (
            [rank] => 0
            [ID] => 656
            [run_id] => 38
            [user] => sasha.bezugliy@gmail.com
            [first_name] => Саша
            [last_name] => Безуглий
            [user_id] => 261
            [date] => 2016-10-01 09:22:43
            [time] => 24:07:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 8
            [personal_best] => 24:07:00
        )

    [48] => stdClass Object
        (
            [rank] => 0
            [ID] => 395
            [run_id] => 28
            [user] => aleksejpivovar@yandex.ru
            [first_name] => Олексій
            [last_name] => Пивоваров
            [user_id] => 299
            [date] => 2016-09-10 13:55:40
            [time] => 24:13:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 24:13:00
        )

    [49] => stdClass Object
        (
            [rank] => 0
            [ID] => 626
            [run_id] => 37
            [user] => perfekt-alla@yandex.ru
            [first_name] => Алла
            [last_name] => Бойко
            [user_id] => 94
            [date] => 2016-09-24 09:22:59
            [time] => 24:19:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 11
            [personal_best] => 24:19:00
        )

    [50] => stdClass Object
        (
            [rank] => 0
            [ID] => 326
            [run_id] => 22
            [user] => andrybitko@gmail.com
            [first_name] => Андрій
            [last_name] => Битько
            [user_id] => 151
            [date] => 2016-08-27 11:09:06
            [time] => 24:32:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 24:32:00
        )

    [51] => stdClass Object
        (
            [rank] => 0
            [ID] => 1253
            [run_id] => 64
            [user] => 0634378@gmail.com
            [first_name] => Andrew
            [last_name] => Ostapchuk
            [user_id] => 635
            [date] => 2016-11-12 09:31:27
            [time] => 24:35:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 24:35:00
        )

    [52] => stdClass Object
        (
            [rank] => 0
            [ID] => 4276
            [run_id] => 235
            [user] => vasyl.fedinchuk@gmail.com
            [first_name] => Vasyl
            [last_name] => Fedinchuk
            [user_id] => 1603
            [date] => 2017-07-08 07:40:33
            [time] => 24:42:00
            [location_title] => Франківськ: Міське озеро 
            [location_link] => https://runday.org/?post_type=runday_location&p=25930
            [location_id] => 25930
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 24:42:00
        )

    [53] => stdClass Object
        (
            [rank] => 0
            [ID] => 952
            [run_id] => 48
            [user] => admin_dolarnet@mail.ru
            [first_name] => Володимир
            [last_name] => Ястремський
            [user_id] => 499
            [date] => 2016-10-15 10:04:16
            [time] => 24:44:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 24:44:00
        )

    [54] => stdClass Object
        (
            [rank] => 0
            [ID] => 3870
            [run_id] => 205
            [user] => victoriya.fadina@gmail.com
            [first_name] => Вікторія
            [last_name] => Фадіна
            [user_id] => 1161
            [date] => 2017-06-10 09:30:43
            [time] => 24:45:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 24:45:00
        )

    [55] => stdClass Object
        (
            [rank] => 0
            [ID] => 1121
            [run_id] => 57
            [user] => tekhanu@meta.ua
            [first_name] => Маріанна
            [last_name] => Янів
            [user_id] => 492
            [date] => 2016-10-29 09:56:09
            [time] => 24:46:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 24:46:00
        )

    [56] => stdClass Object
        (
            [rank] => 0
            [ID] => 956
            [run_id] => 48
            [user] => vitalij.osadchij.123@gmail.com
            [first_name] => Віталій
            [last_name] => Осадчий
            [user_id] => 495
            [date] => 2016-10-15 10:04:16
            [time] => 24:54:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 24:54:00
        )

    [57] => stdClass Object
        (
            [rank] => 0
            [ID] => 611
            [run_id] => 36
            [user] => musindra26@mail.ru
            [first_name] => Valeria
            [last_name] => Samusieva
            [user_id] => 260
            [date] => 2016-09-24 09:21:50
            [time] => 24:56:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 2
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 6
            [personal_best] => 24:56:00
        )

    [58] => stdClass Object
        (
            [rank] => 0
            [ID] => 1711
            [run_id] => 89
            [user] => kurinsky_ka@mail.ru
            [first_name] => Кирилл
            [last_name] => Куринский
            [user_id] => 772
            [date] => 2016-12-31 11:47:21
            [time] => 25:00:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 25:00:00
        )

    [59] => stdClass Object
        (
            [rank] => 0
            [ID] => 194
            [run_id] => 15
            [user] => vera.first.ivanova@gmail.com
            [first_name] => Віра
            [last_name] => Іванова
            [user_id] => 178
            [date] => 2016-08-13 09:16:59
            [time] => 25:02:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 25:02:00
        )

    [60] => stdClass Object
        (
            [rank] => 0
            [ID] => 523
            [run_id] => 32
            [user] => olena.helen@gmail.com
            [first_name] => Olena
            [last_name] => Bondarenko
            [user_id] => 375
            [date] => 2016-09-18 04:20:29
            [time] => 25:29:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 7
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 11
            [personal_best] => 25:29:00
        )

    [61] => stdClass Object
        (
            [rank] => 0
            [ID] => 196
            [run_id] => 15
            [user] => kirill.krasyuk@gmail.com
            [first_name] => Кирилл
            [last_name] => Красюк
            [user_id] => 192
            [date] => 2016-08-13 09:16:59
            [time] => 25:34:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 25:34:00
        )

    [62] => stdClass Object
        (
            [rank] => 0
            [ID] => 2369
            [run_id] => 125
            [user] => shevtsiv.andriy@gmail.com
            [first_name] => Андрій
            [last_name] => Шевців
            [user_id] => 224
            [date] => 2017-03-04 21:55:09
            [time] => 25:44:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 25:44:00
        )

    [63] => stdClass Object
        (
            [rank] => 0
            [ID] => 1328
            [run_id] => 67
            [user] => biltar@ukr.net
            [first_name] => Тарас
            [last_name] => Білинський
            [user_id] => 624
            [date] => 2016-11-19 11:58:18
            [time] => 25:53:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 25:53:00
        )

    [64] => stdClass Object
        (
            [rank] => 0
            [ID] => 1123
            [run_id] => 57
            [user] => annita.bonnita@mail.ru
            [first_name] => Анна
            [last_name] => Тименко
            [user_id] => 590
            [date] => 2016-10-29 09:56:09
            [time] => 26:03:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 26:03:00
        )

    [65] => stdClass Object
        (
            [rank] => 5
            [ID] => 52
            [run_id] => 8
            [user] => rsrda@ukr.net
            [first_name] => Руслан
            [last_name] => Синєгуб
            [user_id] => 86
            [date] => 2016-07-30 07:58:33
            [time] => 26:20:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 26:20:00
        )

    [66] => stdClass Object
        (
            [rank] => 4
            [ID] => 62
            [run_id] => 9
            [user] => ighosdalo@yahoo.com
            [first_name] => Ighodalo
            [last_name] => Otokhagua
            [user_id] => 146
            [date] => 2016-08-06 08:45:46
            [time] => 26:39:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 26:39:00
        )

    [67] => stdClass Object
        (
            [rank] => 0
            [ID] => 1155
            [run_id] => 58
            [user] => sales1000viza@gmail.com
            [first_name] => Галина
            [last_name] => Береза
            [user_id] => 562
            [date] => 2016-11-05 09:26:08
            [time] => 26:40:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 26:40:00
        )

    [68] => stdClass Object
        (
            [rank] => 0
            [ID] => 3134
            [run_id] => 161
            [user] => roman.galu4anun@gmail.com
            [first_name] => Roman
            [last_name] => Luchkiv
            [user_id] => 655
            [date] => 2017-04-22 11:11:03
            [time] => 26:51:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 5
            [personal_best] => 26:51:00
        )

    [69] => stdClass Object
        (
            [rank] => 0
            [ID] => 199
            [run_id] => 15
            [user] => anna.strit@gmail.com
            [first_name] => Ганна
            [last_name] => Стретович
            [user_id] => 170
            [date] => 2016-08-13 09:16:59
            [time] => 26:57:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 26:57:00
        )

    [70] => stdClass Object
        (
            [rank] => 0
            [ID] => 1454
            [run_id] => 74
            [user] => Skorikovaolga27@gmail.com
            [first_name] => Оля
            [last_name] => Скорікова
            [user_id] => 654
            [date] => 2016-11-26 13:55:23
            [time] => 27:17:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 27:17:00
        )

    [71] => stdClass Object
        (
            [rank] => 0
            [ID] => 3032
            [run_id] => 153
            [user] => irena04bodrik@gmail.com
            [first_name] => Іра
            [last_name] => Бодрик
            [user_id] => 1025
            [date] => 2017-04-15 21:00:46
            [time] => 27:17:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 27:17:00
        )

    [72] => stdClass Object
        (
            [rank] => 0
            [ID] => 1720
            [run_id] => 89
            [user] => varf88@gmail.com
            [first_name] => Анатолий 
            [last_name] => Варфоломеев 
            [user_id] => 780
            [date] => 2016-12-31 11:47:21
            [time] => 27:19:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 27:19:00
        )

    [73] => stdClass Object
        (
            [rank] => 0
            [ID] => 1510
            [run_id] => 77
            [user] => aliso4ka89@mail.ua
            [first_name] => Наталя
            [last_name] => Наталя
            [user_id] => 665
            [date] => 2016-12-03 09:05:10
            [time] => 27:40:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 8
            [personal_best] => 27:40:00
        )

    [74] => stdClass Object
        (
            [rank] => 0
            [ID] => 3497
            [run_id] => 183
            [user] => tarsekona@yandex.ru
            [first_name] => Svetlana
            [last_name] => Psaryuk
            [user_id] => 978
            [date] => 2017-05-13 07:14:15
            [time] => 27:49:00
            [location_title] => Одеса: Парк Шевченка
            [location_link] => https://runday.org/?post_type=runday_location&p=25771
            [location_id] => 25771
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 10
            [personal_best] => 27:49:00
        )

    [75] => stdClass Object
        (
            [rank] => 0
            [ID] => 2375
            [run_id] => 125
            [user] => yuriynyay@gmail.com
            [first_name] => Юрій
            [last_name] => Няй
            [user_id] => 881
            [date] => 2017-03-04 21:55:09
            [time] => 28:10:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 28:10:00
        )

    [76] => stdClass Object
        (
            [rank] => 0
            [ID] => 1870
            [run_id] => 96
            [user] => diamant.anya@gmail.com
            [first_name] => Анна
            [last_name] => Діамант
            [user_id] => 812
            [date] => 2017-01-14 18:26:32
            [time] => 28:15:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 28:15:00
        )

    [77] => stdClass Object
        (
            [rank] => 0
            [ID] => 2172
            [run_id] => 115
            [user] => wiktoriya.luchka@gmail.com
            [first_name] => Вікторія
            [last_name] => Лучка
            [user_id] => 854
            [date] => 2017-02-18 23:09:16
            [time] => 28:19:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 28:19:00
        )

    [78] => stdClass Object
        (
            [rank] => 0
            [ID] => 201
            [run_id] => 15
            [user] => anastasie@veedoo.io
            [first_name] => Anastasia
            [last_name] => Ivanowsky
            [user_id] => 185
            [date] => 2016-08-13 09:16:59
            [time] => 28:35:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => Veedoo
            [club_link] => http://runday.org/?post_type=runday_club&p=24647
            [volunteered] => 1
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 28:35:00
        )

    [79] => stdClass Object
        (
            [rank] => 0
            [ID] => 1635
            [run_id] => 87
            [user] => marianamukutun11@mail.ru
            [first_name] => Мар'яна
            [last_name] => Бойко 
            [user_id] => 718
            [date] => 2016-12-24 10:51:38
            [time] => 28:40:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 28:40:00
        )

    [80] => stdClass Object
        (
            [rank] => 0
            [ID] => 1721
            [run_id] => 89
            [user] => p.s.saska@gmail.com
            [first_name] => Alex
            [last_name] => Parkhomenko
            [user_id] => 775
            [date] => 2016-12-31 11:47:21
            [time] => 28:45:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 28:45:00
        )

    [81] => stdClass Object
        (
            [rank] => 0
            [ID] => 1334
            [run_id] => 67
            [user] => spok_9@ukr.net
            [first_name] => Сергій
            [last_name] => Пазинич
            [user_id] => 434
            [date] => 2016-11-19 11:58:18
            [time] => 28:57:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 28:57:00
        )

    [82] => stdClass Object
        (
            [rank] => 0
            [ID] => 204
            [run_id] => 15
            [user] => aerm2103@gmail.com
            [first_name] => Анастасія
            [last_name] => Єрмакова
            [user_id] => 182
            [date] => 2016-08-13 09:16:59
            [time] => 29:16:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 29:16:00
        )

    [83] => stdClass Object
        (
            [rank] => 0
            [ID] => 266
            [run_id] => 18
            [user] => sokolskydima@yahoo.com
            [first_name] => Дима
            [last_name] => Сокол
            [user_id] => 166
            [date] => 2016-08-20 07:28:01
            [time] => 29:39:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 29:39:00
        )

    [84] => stdClass Object
        (
            [rank] => 0
            [ID] => 1976
            [run_id] => 103
            [user] => yulia.ryabko@gmail.com
            [first_name] => Юлія
            [last_name] => Рябко
            [user_id] => 834
            [date] => 2017-01-28 14:50:19
            [time] => 30:15:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 30:15:00
        )

    [85] => stdClass Object
        (
            [rank] => 0
            [ID] => 1128
            [run_id] => 57
            [user] => lighta92@mail.ru
            [first_name] => Світлана
            [last_name] => Сєдих
            [user_id] => 561
            [date] => 2016-10-29 09:56:09
            [time] => 30:19:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 30:19:00
        )

    [86] => stdClass Object
        (
            [rank] => 0
            [ID] => 1306
            [run_id] => 66
            [user] => radionenko.tatiana@gmail.com
            [first_name] => Таня
            [last_name] => Радионенко
            [user_id] => 630
            [date] => 2016-11-19 11:51:36
            [time] => 31:02:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 31:02:00
        )

    [87] => stdClass Object
        (
            [rank] => 0
            [ID] => 1872
            [run_id] => 96
            [user] => bratus.igor@icloud.com
            [first_name] => Igor
            [last_name] => Bratus
            [user_id] => 810
            [date] => 2017-01-14 18:26:32
            [time] => 31:03:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 31:03:00
        )

    [88] => stdClass Object
        (
            [rank] => 0
            [ID] => 532
            [run_id] => 32
            [user] => smiledbp7@gmail.com
            [first_name] => Daria
            [last_name] => :-)
            [user_id] => 76
            [date] => 2016-09-18 04:20:29
            [time] => 31:19:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 3
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 6
            [personal_best] => 31:19:00
        )

    [89] => stdClass Object
        (
            [rank] => 0
            [ID] => 798
            [run_id] => 43
            [user] => o.gritsak@gmail.com
            [first_name] => Olga
            [last_name] => Grytsak
            [user_id] => 430
            [date] => 2016-10-01 12:24:56
            [time] => 31:23:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 31:23:00
        )

    [90] => stdClass Object
        (
            [rank] => 0
            [ID] => 614
            [run_id] => 36
            [user] => anna.striletska@gmail.com
            [first_name] => Anna
            [last_name] => STRILETSKA
            [user_id] => 399
            [date] => 2016-09-24 09:21:50
            [time] => 31:30:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 31:30:00
        )

    [91] => stdClass Object
        (
            [rank] => 0
            [ID] => 2223
            [run_id] => 118
            [user] => barskaya99@mail.ru
            [first_name] => Алла
            [last_name] => Барская 
            [user_id] => 874
            [date] => 2017-02-25 10:06:51
            [time] => 31:42:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 31:42:00
        )

    [92] => stdClass Object
        (
            [rank] => 9
            [ID] => 67
            [run_id] => 9
            [user] => ella.vasilevsakaya@gmail.com
            [first_name] => Елла
            [last_name] => Василевська
            [user_id] => 139
            [date] => 2016-08-06 08:45:46
            [time] => 31:47:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 31:47:00
        )

    [93] => stdClass Object
        (
            [rank] => 0
            [ID] => 1095
            [run_id] => 56
            [user] => annachorna@ukr.net
            [first_name] =>  Анна
            [last_name] => Чорна
            [user_id] => 582
            [date] => 2016-10-29 09:09:06
            [time] => 32:25:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 32:25:00
        )

    [94] => stdClass Object
        (
            [rank] => 0
            [ID] => 2382
            [run_id] => 125
            [user] => bodjanochka2@gmail.com
            [first_name] => Богдана
            [last_name] => Дутко
            [user_id] => 907
            [date] => 2017-03-04 21:55:09
            [time] => 34:10:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 34:10:00
        )

    [95] => stdClass Object
        (
            [rank] => 0
            [ID] => 806
            [run_id] => 43
            [user] => pchelav@gmail.com
            [first_name] => Віталій
            [last_name] => Пчолкін
            [user_id] => 418
            [date] => 2016-10-01 12:24:56
            [time] => 37:14:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 37:14:00
        )

    [96] => stdClass Object
        (
            [rank] => 0
            [ID] => 1734
            [run_id] => 89
            [user] => olegparhomenko@mail.ru
            [first_name] => Олег 
            [last_name] => Пархоменко 
            [user_id] => 777
            [date] => 2016-12-31 11:47:21
            [time] => 38:21:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 38:21:00
        )

    [97] => stdClass Object
        (
            [rank] => 0
            [ID] => 430
            [run_id] => 227
            [user] => alena.lashshenko199215@gmail.com
            [first_name] => Альона 
            [last_name] => Лащенко 
            [user_id] => 287
            [date] => 2017-07-01 12:06:08
            [time] => 59:59:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 30
            [is_only_volunteered] => 1
            [is_volunteered] => 1
            [volunteer_position] => Tokens
            [runs] => 
            [personal_best] => 59:59:00
        )

    [98] => stdClass Object
        (
            [rank] => 0
            [ID] => 2211
            [run_id] => 220
            [user] => olgazaporozhets@yahoo.com
            [first_name] => Olga
            [last_name] => Zaporozhets
            [user_id] => 861
            [date] => 2017-06-24 17:39:33
            [time] => 59:59:00
            [location_title] => Одеса: Парк Шевченка
            [location_link] => https://runday.org/?post_type=runday_location&p=25771
            [location_id] => 25771
            [club_title] => 
            [club_link] => 
            [volunteered] => 6
            [is_only_volunteered] => 1
            [is_volunteered] => 1
            [volunteer_position] => Timekeeper
            [runs] => 
            [personal_best] => 59:59:00
        )

    [99] => stdClass Object
        (
            [rank] => 0
            [ID] => 421
            [run_id] => 18
            [user] => lyuda.dovgan@gmail.com
            [first_name] => Liudmyla
            [last_name] => Dovgan
            [user_id] => 84
            [date] => 2016-08-20 07:28:01
            [time] => 59:59:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 2
            [is_only_volunteered] => 1
            [is_volunteered] => 1
            [volunteer_position] => Tokens
            [runs] => 
            [personal_best] => 59:59:00
        )

    [100] => stdClass Object
        (
            [rank] => 0
            [ID] => 962
            [run_id] => 49
            [user] => opiopchenko@gmail.com
            [first_name] => Tetiana
            [last_name] => Opiopchenko
            [user_id] => 65
            [date] => 2016-10-22 09:11:07
            [time] => 59:59:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 1
            [is_volunteered] => 1
            [volunteer_position] => Warm-Up/Down
            [runs] => 
            [personal_best] => 59:59:00
        )

    [101] => stdClass Object
        (
            [rank] => 0
            [ID] => 425
            [run_id] => 8
            [user] => zzoojek@gmail.com
            [first_name] => Petro
            [last_name] => Dmytrenko
            [user_id] => 85
            [date] => 2016-07-30 07:58:33
            [time] => 59:59:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 1
            [is_volunteered] => 1
            [volunteer_position] => Photographer
            [runs] => 
            [personal_best] => 59:59:00
        )

    [102] => stdClass Object
        (
            [rank] => 0
            [ID] => 482
            [run_id] => 20
            [user] => olegchynus22@gmail.com
            [first_name] => Олег
            [last_name] => Чунис
            [user_id] => 176
            [date] => 2016-08-20 10:00:01
            [time] => 59:59:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 1
            [is_volunteered] => 1
            [volunteer_position] => Scanning
            [runs] => 
            [personal_best] => 59:59:00
        )

)
Місце Ім’я Час Локація
1 Ростислав Карташов 16:18:00 Стрийський парк
2 Вадим Банков 16:35:00 Одеса: Парк Шевченка
3 Андрій Мартинюк 17:49:00 Тернопіль: Набережна ставу
4 Artem Slotin 18:04:00 Стрийський парк
5 микола трачук 19:10:00 Тернопіль: Набережна ставу
6 Сергій Сорокін 19:18:00 Труханів Острів, Київ
7 Олена Федорова 19:19:00 Стрийський парк
8 Roman Shp'yelyk 19:32:00 Стрийський парк
9 Олексій Степанов 19:34:00 Тернопіль: Набережна ставу
10 Петро Чернега 20:09:00 Стрийський парк

Чоловіки

SELECT 
		result.event_place as rank, 
		result.ID, 
		run.ID as run_id, 
		user.display_name as user, 
		first_name.meta_value as first_name, 
		last_name.meta_value as last_name, 
		user.ID as user_id, 
		run.date as date, 
		result.time as time, 
		
		location_post.post_title as location_title, 
		location_post.guid as location_link, 
		location_post.ID as location_id,

		club_post.post_title as club_title,
		club_post.guid as club_link,

		volunteer.volunteered as volunteered,
		is_only_volunteered.value as is_only_volunteered,
		result.volunteered as is_volunteered,
		role.title as volunteer_position,

		runner.runs as runs,

		personal_best.value as personal_best

		FROM (SELECT res1.ID, max(res1.run_id) as run_id, res1.user_id, res1.event_place, res1.time, volunteered, volunteer_position
			FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 25
			            AND datediff(now(), meta_value) / 365.25 < 30
					)
				AND user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_sex'
			            AND meta_value = '1'
					)
				) AS res1
			INNER JOIN (
				SELECT user_id, min(time) as time
	            FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 25
			            AND datediff(now(), meta_value) / 365.25 < 30
					)
				AND user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_sex'
			            AND meta_value = '1'
					)
				) AS res3
	            GROUP BY user_id
				) as res2
			ON (res2.user_id = res1.user_id AND res1.time = res2.time)
			GROUP BY user_id
		) as result
		
		LEFT JOIN wp_runday_run as run
		ON result.run_id = run.ID
		
		LEFT JOIN wp_posts as location_post
		ON run.location_id = location_post.ID
		
		LEFT JOIN wp_users as user
		ON result.user_id = user.ID
		
		LEFT JOIN wp_usermeta as first_name
		ON first_name.user_id = user.ID
	    AND first_name.meta_key = 'first_name'
		
		LEFT JOIN wp_usermeta as last_name
		ON last_name.user_id = user.ID
	    AND last_name.meta_key = 'last_name'
		
		LEFT JOIN wp_usermeta as club
		ON club.user_id = user.ID
	    AND club.meta_key = 'club'
		
		LEFT JOIN wp_posts as club_post
		ON club.meta_value = club_post.post_name
		AND club.meta_value != ''
		AND club_post.post_type = 'runday_club'

		LEFT JOIN (
			SELECT user_id, MIN(volunteered) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as is_only_volunteered
		ON is_only_volunteered.user_id = user.ID

		LEFT JOIN (
			SELECT user_id, MIN(time) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as personal_best
		ON personal_best.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, SUM(volunteered) as volunteered
			FROM (
	            SELECT user_id, MAX(volunteered) AS volunteered
				FROM wp_runday_result
				GROUP BY run_id, user_id) as volunteered_per_run
			GROUP BY user_id
			) as volunteer
		ON volunteer.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, count(*) as runs
			FROM (
	            SELECT user_id
				FROM wp_runday_result
				WHERE volunteered = 0) as only_runs
			GROUP BY user_id
			) as runner
		ON runner.user_id = user.ID

		LEFT JOIN wp_runday_volunteer_positions  as role
		ON result.volunteer_position = role.ID

		WHERE 1 = 1
		 ORDER BY  time ASC, volunteered DESCArray
(
    [0] => stdClass Object
        (
            [rank] => 0
            [ID] => 287
            [run_id] => 20
            [user] => rostik777@gmail.com
            [first_name] => Ростислав
            [last_name] => Карташов
            [user_id] => 255
            [date] => 2016-08-20 10:00:01
            [time] => 16:18:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 28
            [personal_best] => 16:18:00
        )

    [1] => stdClass Object
        (
            [rank] => 0
            [ID] => 3944
            [run_id] => 210
            [user] => vadim.bankov@gmail.com
            [first_name] => Вадим
            [last_name] => Банков
            [user_id] => 1209
            [date] => 2017-06-17 14:17:43
            [time] => 16:35:00
            [location_title] => Одеса: Парк Шевченка
            [location_link] => https://runday.org/?post_type=runday_location&p=25771
            [location_id] => 25771
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 11
            [personal_best] => 16:35:00
        )

    [2] => stdClass Object
        (
            [rank] => 0
            [ID] => 1629
            [run_id] => 87
            [user] => martyniuk2002@ukr.net
            [first_name] => Андрій
            [last_name] => Мартинюк
            [user_id] => 728
            [date] => 2016-12-24 10:51:38
            [time] => 17:49:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 17:49:00
        )

    [3] => stdClass Object
        (
            [rank] => 0
            [ID] => 2338
            [run_id] => 125
            [user] => orient.ck@gmail.com
            [first_name] => Artem
            [last_name] => Slotin
            [user_id] => 379
            [date] => 2017-03-04 21:55:09
            [time] => 18:04:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 18:04:00
        )

    [4] => stdClass Object
        (
            [rank] => 0
            [ID] => 935
            [run_id] => 48
            [user] => advokat@ukr.net
            [first_name] => микола
            [last_name] => трачук
            [user_id] => 535
            [date] => 2016-10-15 10:04:16
            [time] => 19:10:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 19:10:00
        )

    [5] => stdClass Object
        (
            [rank] => 0
            [ID] => 4164
            [run_id] => 227
            [user] => sergulio_1989@ukr.net
            [first_name] => Сергій
            [last_name] => Сорокін
            [user_id] => 1273
            [date] => 2017-07-01 12:06:08
            [time] => 19:18:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 19:18:00
        )

    [6] => stdClass Object
        (
            [rank] => 0
            [ID] => 289
            [run_id] => 20
            [user] => romchyk005@gmail.com
            [first_name] => Roman
            [last_name] => Shp'yelyk 
            [user_id] => 249
            [date] => 2016-08-20 10:00:01
            [time] => 19:32:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 19:32:00
        )

    [7] => stdClass Object
        (
            [rank] => 0
            [ID] => 937
            [run_id] => 48
            [user] => stepashka_@ukr.net
            [first_name] => Олексій
            [last_name] => Степанов
            [user_id] => 526
            [date] => 2016-10-15 10:04:16
            [time] => 19:34:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 19:34:00
        )

    [8] => stdClass Object
        (
            [rank] => 0
            [ID] => 2394
            [run_id] => 126
            [user] => chernegapetro@gmail.com
            [first_name] => Петро
            [last_name] => Чернега
            [user_id] => 815
            [date] => 2017-03-11 21:34:33
            [time] => 20:09:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 6
            [personal_best] => 20:09:00
        )

    [9] => stdClass Object
        (
            [rank] => 0
            [ID] => 918
            [run_id] => 47
            [user] => khmelovskyi@outlook.com
            [first_name] => Volodymyr
            [last_name] => Khmelovskyi
            [user_id] => 478
            [date] => 2016-10-15 08:02:51
            [time] => 20:19:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 8
            [personal_best] => 20:19:00
        )

    [10] => stdClass Object
        (
            [rank] => 0
            [ID] => 938
            [run_id] => 48
            [user] => serhiyjj@gmail.com
            [first_name] => Сергій
            [last_name] => Кучирка
            [user_id] => 514
            [date] => 2016-10-15 10:04:16
            [time] => 20:23:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 20:23:00
        )

    [11] => stdClass Object
        (
            [rank] => 0
            [ID] => 1693
            [run_id] => 89
            [user] => dkcompany@bk.ru
            [first_name] => Виталик 
            [last_name] => Пляциков
            [user_id] => 774
            [date] => 2016-12-31 11:47:21
            [time] => 20:26:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 20:26:00
        )

    [12] => stdClass Object
        (
            [rank] => 0
            [ID] => 388
            [run_id] => 28
            [user] => mobiaks@mail.ua
            [first_name] => Петро 
            [last_name] => Гук
            [user_id] => 361
            [date] => 2016-09-10 13:55:40
            [time] => 20:33:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 20:33:00
        )

    [13] => stdClass Object
        (
            [rank] => 0
            [ID] => 1109
            [run_id] => 57
            [user] => Leon4444@i.ua
            [first_name] => Леонід
            [last_name] => Шамарін
            [user_id] => 350
            [date] => 2016-10-29 09:56:09
            [time] => 20:34:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 20:34:00
        )

    [14] => stdClass Object
        (
            [rank] => 0
            [ID] => 2773
            [run_id] => 142
            [user] => iva@biir.dk
            [first_name] => Ievgenii
            [last_name] => Vasylenko
            [user_id] => 1103
            [date] => 2017-04-01 11:57:35
            [time] => 20:46:00
            [location_title] => Одеса: Парк Шевченка
            [location_link] => https://runday.org/?post_type=runday_location&p=25771
            [location_id] => 25771
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 5
            [personal_best] => 20:46:00
        )

    [15] => stdClass Object
        (
            [rank] => 0
            [ID] => 351
            [run_id] => 25
            [user] => andrew-pb@mail.ru
            [first_name] => Андрій
            [last_name] => Максимук
            [user_id] => 309
            [date] => 2016-09-03 08:20:44
            [time] => 21:17:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 21:17:00
        )

    [16] => stdClass Object
        (
            [rank] => 0
            [ID] => 183
            [run_id] => 15
            [user] => orest.zub@gmail.com
            [first_name] => Orest
            [last_name] => Zub
            [user_id] => 199
            [date] => 2016-08-13 09:16:59
            [time] => 21:24:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 2
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 21:24:00
        )

    [17] => stdClass Object
        (
            [rank] => 0
            [ID] => 1568
            [run_id] => 83
            [user] => trachukiv@gmail.com
            [first_name] => Ігор
            [last_name] => Трачук
            [user_id] => 677
            [date] => 2016-12-17 11:04:53
            [time] => 21:35:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 21:35:00
        )

    [18] => stdClass Object
        (
            [rank] => 0
            [ID] => 2308
            [run_id] => 123
            [user] => crfcrm@ukr.net
            [first_name] => Александр
            [last_name] => Рекало
            [user_id] => 776
            [date] => 2017-03-04 10:08:45
            [time] => 21:37:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 21:37:00
        )

    [19] => stdClass Object
        (
            [rank] => 0
            [ID] => 1277
            [run_id] => 65
            [user] => ishenko-dmitrij@mail.ru
            [first_name] => ДМИТРО
            [last_name] => ІЩЕНКО
            [user_id] => 564
            [date] => 2016-11-12 11:09:02
            [time] => 21:38:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 21:38:00
        )

    [20] => stdClass Object
        (
            [rank] => 0
            [ID] => 1250
            [run_id] => 64
            [user] => alex-kuts@ukr.net
            [first_name] => Олександр
            [last_name] => Куць
            [user_id] => 585
            [date] => 2016-11-12 09:31:27
            [time] => 21:39:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 21:39:00
        )

    [21] => stdClass Object
        (
            [rank] => 0
            [ID] => 2350
            [run_id] => 125
            [user] => nhlynka@gmail.com
            [first_name] => Mykola
            [last_name] => Hlynka
            [user_id] => 906
            [date] => 2017-03-04 21:55:09
            [time] => 21:40:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 21:40:00
        )

    [22] => stdClass Object
        (
            [rank] => 0
            [ID] => 3732
            [run_id] => 199
            [user] => oleg.knol@gmail.com
            [first_name] => Олег
            [last_name] => Кноль
            [user_id] => 524
            [date] => 2017-06-03 11:02:44
            [time] => 21:52:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 3
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 10
            [personal_best] => 21:52:00
        )

    [23] => stdClass Object
        (
            [rank] => 0
            [ID] => 1935
            [run_id] => 101
            [user] => mikeonyshkiv@gmail.com
            [first_name] => Михайло
            [last_name] => Онишків
            [user_id] => 546
            [date] => 2017-01-28 14:14:01
            [time] => 21:54:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 21:54:00
        )

    [24] => stdClass Object
        (
            [rank] => 0
            [ID] => 1174
            [run_id] => 60
            [user] => tyrist.13@gmail.com
            [first_name] => Рома
            [last_name] => Мороз
            [user_id] => 589
            [date] => 2016-11-05 09:35:08
            [time] => 21:56:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => СТК "Легіон"
            [club_link] => https://runday.org/?post_type=runday_club&p=25347
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 21:56:00
        )

    [25] => stdClass Object
        (
            [rank] => 0
            [ID] => 1753
            [run_id] => 90
            [user] => skailer1313@gmail.com
            [first_name] => Олексій
            [last_name] => Зенін
            [user_id] => 796
            [date] => 2016-12-31 11:55:01
            [time] => 21:58:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 21:58:00
        )

    [26] => stdClass Object
        (
            [rank] => 0
            [ID] => 4034
            [run_id] => 218
            [user] => andriy.polevy@gmail.com
            [first_name] => Андрій
            [last_name] => Полевий
            [user_id] => 649
            [date] => 2017-06-24 09:47:19
            [time] => 22:04:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 6
            [personal_best] => 22:04:00
        )

    [27] => stdClass Object
        (
            [rank] => 0
            [ID] => 403
            [run_id] => 29
            [user] => toras.cn@gmail.com
            [first_name] => Taras
            [last_name] => Lototsky
            [user_id] => 291
            [date] => 2016-09-10 14:00:39
            [time] => 22:19:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 6
            [personal_best] => 22:19:00
        )

    [28] => stdClass Object
        (
            [rank] => 0
            [ID] => 942
            [run_id] => 48
            [user] => Muxayloforest@gmail.com
            [first_name] => Михайло
            [last_name] => Стухляк
            [user_id] => 525
            [date] => 2016-10-15 10:04:16
            [time] => 22:23:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 22:23:00
        )

    [29] => stdClass Object
        (
            [rank] => 0
            [ID] => 776
            [run_id] => 43
            [user] => oleksandrkasheev@gmail.com
            [first_name] => Олександр
            [last_name] => Кащеєв
            [user_id] => 439
            [date] => 2016-10-01 12:24:56
            [time] => 22:27:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 22:27:00
        )

    [30] => stdClass Object
        (
            [rank] => 0
            [ID] => 290
            [run_id] => 20
            [user] => desingalex1989@gmail.com
            [first_name] => Олексій
            [last_name] => Бочаров
            [user_id] => 219
            [date] => 2016-08-20 10:00:01
            [time] => 22:33:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 22:33:00
        )

    [31] => stdClass Object
        (
            [rank] => 0
            [ID] => 2562
            [run_id] => 135
            [user] => flayr@i.ua
            [first_name] => Василь
            [last_name] => Клак
            [user_id] => 829
            [date] => 2017-03-25 00:04:03
            [time] => 22:38:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 5
            [personal_best] => 22:38:00
        )

    [32] => stdClass Object
        (
            [rank] => 0
            [ID] => 777
            [run_id] => 43
            [user] => bogvelik123@gmail.com
            [first_name] => Андрій
            [last_name] => Тишковець
            [user_id] => 385
            [date] => 2016-10-01 12:24:56
            [time] => 22:38:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 22:38:00
        )

    [33] => stdClass Object
        (
            [rank] => 0
            [ID] => 1795
            [run_id] => 91
            [user] => y.mishchuk@gmail.com
            [first_name] => Юрій
            [last_name] => Міщук
            [user_id] => 511
            [date] => 2016-12-31 12:07:43
            [time] => 23:08:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 10
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 23:08:00
        )

    [34] => stdClass Object
        (
            [rank] => 0
            [ID] => 4436
            [run_id] => 246
            [user] => vmmedvid@gmail.com
            [first_name] => Володимир
            [last_name] => Медвідь
            [user_id] => 1633
            [date] => 2017-07-15 15:14:58
            [time] => 23:12:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 23:12:00
        )

    [35] => stdClass Object
        (
            [rank] => 0
            [ID] => 3290
            [run_id] => 172
            [user] => arbrix@gmail.com
            [first_name] => Ivan
            [last_name] => Kutuzov
            [user_id] => 668
            [date] => 2017-05-06 08:24:06
            [time] => 23:26:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => SoftServe
            [club_link] => https://runday.org/?post_type=runday_club&p=25168
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 23:26:00
        )

    [36] => stdClass Object
        (
            [rank] => 0
            [ID] => 1940
            [run_id] => 101
            [user] => Oleg.Zarevennyi@gmail.com
            [first_name] => Oleg
            [last_name] => Zarevennyi
            [user_id] => 663
            [date] => 2017-01-28 14:14:01
            [time] => 23:29:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 23:29:00
        )

    [37] => stdClass Object
        (
            [rank] => 0
            [ID] => 518
            [run_id] => 32
            [user] => romanaleks.m@gmail.com
            [first_name] => Роман
            [last_name] => Митрофанов
            [user_id] => 311
            [date] => 2016-09-18 04:20:29
            [time] => 23:30:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 7
            [personal_best] => 23:30:00
        )

    [38] => stdClass Object
        (
            [rank] => 0
            [ID] => 944
            [run_id] => 48
            [user] => karpa.yura@gmail.com
            [first_name] => Yuriy
            [last_name] => Karpa
            [user_id] => 528
            [date] => 2016-10-15 10:04:16
            [time] => 23:30:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 23:30:00
        )

    [39] => stdClass Object
        (
            [rank] => 0
            [ID] => 2362
            [run_id] => 125
            [user] => orest.oleskiv@gmail.com
            [first_name] => Орест
            [last_name] => Олеськів
            [user_id] => 887
            [date] => 2017-03-04 21:55:09
            [time] => 23:31:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 23:31:00
        )

    [40] => stdClass Object
        (
            [rank] => 0
            [ID] => 189
            [run_id] => 15
            [user] => Глеба Володимир
            [first_name] => Володимир
            [last_name] => Глеба
            [user_id] => 2
            [date] => 2016-08-13 09:16:59
            [time] => 23:39:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => Veedoo
            [club_link] => http://runday.org/?post_type=runday_club&p=24647
            [volunteered] => 2
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 23:39:00
        )

    [41] => stdClass Object
        (
            [rank] => 0
            [ID] => 3027
            [run_id] => 153
            [user] => dr.volodymyr.vovk@gmail.com
            [first_name] => Володимир
            [last_name] => Вовк
            [user_id] => 912
            [date] => 2017-04-15 21:00:46
            [time] => 23:48:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 23:48:00
        )

    [42] => stdClass Object
        (
            [rank] => 0
            [ID] => 656
            [run_id] => 38
            [user] => sasha.bezugliy@gmail.com
            [first_name] => Саша
            [last_name] => Безуглий
            [user_id] => 261
            [date] => 2016-10-01 09:22:43
            [time] => 24:07:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 8
            [personal_best] => 24:07:00
        )

    [43] => stdClass Object
        (
            [rank] => 0
            [ID] => 395
            [run_id] => 28
            [user] => aleksejpivovar@yandex.ru
            [first_name] => Олексій
            [last_name] => Пивоваров
            [user_id] => 299
            [date] => 2016-09-10 13:55:40
            [time] => 24:13:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 24:13:00
        )

    [44] => stdClass Object
        (
            [rank] => 0
            [ID] => 326
            [run_id] => 22
            [user] => andrybitko@gmail.com
            [first_name] => Андрій
            [last_name] => Битько
            [user_id] => 151
            [date] => 2016-08-27 11:09:06
            [time] => 24:32:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 24:32:00
        )

    [45] => stdClass Object
        (
            [rank] => 0
            [ID] => 1253
            [run_id] => 64
            [user] => 0634378@gmail.com
            [first_name] => Andrew
            [last_name] => Ostapchuk
            [user_id] => 635
            [date] => 2016-11-12 09:31:27
            [time] => 24:35:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 24:35:00
        )

    [46] => stdClass Object
        (
            [rank] => 0
            [ID] => 4276
            [run_id] => 235
            [user] => vasyl.fedinchuk@gmail.com
            [first_name] => Vasyl
            [last_name] => Fedinchuk
            [user_id] => 1603
            [date] => 2017-07-08 07:40:33
            [time] => 24:42:00
            [location_title] => Франківськ: Міське озеро 
            [location_link] => https://runday.org/?post_type=runday_location&p=25930
            [location_id] => 25930
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 24:42:00
        )

    [47] => stdClass Object
        (
            [rank] => 0
            [ID] => 952
            [run_id] => 48
            [user] => admin_dolarnet@mail.ru
            [first_name] => Володимир
            [last_name] => Ястремський
            [user_id] => 499
            [date] => 2016-10-15 10:04:16
            [time] => 24:44:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 24:44:00
        )

    [48] => stdClass Object
        (
            [rank] => 0
            [ID] => 956
            [run_id] => 48
            [user] => vitalij.osadchij.123@gmail.com
            [first_name] => Віталій
            [last_name] => Осадчий
            [user_id] => 495
            [date] => 2016-10-15 10:04:16
            [time] => 24:54:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 24:54:00
        )

    [49] => stdClass Object
        (
            [rank] => 0
            [ID] => 1711
            [run_id] => 89
            [user] => kurinsky_ka@mail.ru
            [first_name] => Кирилл
            [last_name] => Куринский
            [user_id] => 772
            [date] => 2016-12-31 11:47:21
            [time] => 25:00:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 25:00:00
        )

    [50] => stdClass Object
        (
            [rank] => 0
            [ID] => 196
            [run_id] => 15
            [user] => kirill.krasyuk@gmail.com
            [first_name] => Кирилл
            [last_name] => Красюк
            [user_id] => 192
            [date] => 2016-08-13 09:16:59
            [time] => 25:34:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 25:34:00
        )

    [51] => stdClass Object
        (
            [rank] => 0
            [ID] => 2369
            [run_id] => 125
            [user] => shevtsiv.andriy@gmail.com
            [first_name] => Андрій
            [last_name] => Шевців
            [user_id] => 224
            [date] => 2017-03-04 21:55:09
            [time] => 25:44:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 25:44:00
        )

    [52] => stdClass Object
        (
            [rank] => 0
            [ID] => 1328
            [run_id] => 67
            [user] => biltar@ukr.net
            [first_name] => Тарас
            [last_name] => Білинський
            [user_id] => 624
            [date] => 2016-11-19 11:58:18
            [time] => 25:53:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 25:53:00
        )

    [53] => stdClass Object
        (
            [rank] => 5
            [ID] => 52
            [run_id] => 8
            [user] => rsrda@ukr.net
            [first_name] => Руслан
            [last_name] => Синєгуб
            [user_id] => 86
            [date] => 2016-07-30 07:58:33
            [time] => 26:20:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 26:20:00
        )

    [54] => stdClass Object
        (
            [rank] => 4
            [ID] => 62
            [run_id] => 9
            [user] => ighosdalo@yahoo.com
            [first_name] => Ighodalo
            [last_name] => Otokhagua
            [user_id] => 146
            [date] => 2016-08-06 08:45:46
            [time] => 26:39:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 26:39:00
        )

    [55] => stdClass Object
        (
            [rank] => 0
            [ID] => 3134
            [run_id] => 161
            [user] => roman.galu4anun@gmail.com
            [first_name] => Roman
            [last_name] => Luchkiv
            [user_id] => 655
            [date] => 2017-04-22 11:11:03
            [time] => 26:51:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 5
            [personal_best] => 26:51:00
        )

    [56] => stdClass Object
        (
            [rank] => 0
            [ID] => 1720
            [run_id] => 89
            [user] => varf88@gmail.com
            [first_name] => Анатолий 
            [last_name] => Варфоломеев 
            [user_id] => 780
            [date] => 2016-12-31 11:47:21
            [time] => 27:19:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 27:19:00
        )

    [57] => stdClass Object
        (
            [rank] => 0
            [ID] => 2375
            [run_id] => 125
            [user] => yuriynyay@gmail.com
            [first_name] => Юрій
            [last_name] => Няй
            [user_id] => 881
            [date] => 2017-03-04 21:55:09
            [time] => 28:10:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 28:10:00
        )

    [58] => stdClass Object
        (
            [rank] => 0
            [ID] => 1721
            [run_id] => 89
            [user] => p.s.saska@gmail.com
            [first_name] => Alex
            [last_name] => Parkhomenko
            [user_id] => 775
            [date] => 2016-12-31 11:47:21
            [time] => 28:45:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 28:45:00
        )

    [59] => stdClass Object
        (
            [rank] => 0
            [ID] => 1334
            [run_id] => 67
            [user] => spok_9@ukr.net
            [first_name] => Сергій
            [last_name] => Пазинич
            [user_id] => 434
            [date] => 2016-11-19 11:58:18
            [time] => 28:57:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 28:57:00
        )

    [60] => stdClass Object
        (
            [rank] => 0
            [ID] => 266
            [run_id] => 18
            [user] => sokolskydima@yahoo.com
            [first_name] => Дима
            [last_name] => Сокол
            [user_id] => 166
            [date] => 2016-08-20 07:28:01
            [time] => 29:39:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 29:39:00
        )

    [61] => stdClass Object
        (
            [rank] => 0
            [ID] => 1872
            [run_id] => 96
            [user] => bratus.igor@icloud.com
            [first_name] => Igor
            [last_name] => Bratus
            [user_id] => 810
            [date] => 2017-01-14 18:26:32
            [time] => 31:03:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 31:03:00
        )

    [62] => stdClass Object
        (
            [rank] => 0
            [ID] => 806
            [run_id] => 43
            [user] => pchelav@gmail.com
            [first_name] => Віталій
            [last_name] => Пчолкін
            [user_id] => 418
            [date] => 2016-10-01 12:24:56
            [time] => 37:14:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 37:14:00
        )

    [63] => stdClass Object
        (
            [rank] => 0
            [ID] => 1734
            [run_id] => 89
            [user] => olegparhomenko@mail.ru
            [first_name] => Олег 
            [last_name] => Пархоменко 
            [user_id] => 777
            [date] => 2016-12-31 11:47:21
            [time] => 38:21:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 38:21:00
        )

    [64] => stdClass Object
        (
            [rank] => 0
            [ID] => 425
            [run_id] => 8
            [user] => zzoojek@gmail.com
            [first_name] => Petro
            [last_name] => Dmytrenko
            [user_id] => 85
            [date] => 2016-07-30 07:58:33
            [time] => 59:59:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 1
            [is_volunteered] => 1
            [volunteer_position] => Photographer
            [runs] => 
            [personal_best] => 59:59:00
        )

    [65] => stdClass Object
        (
            [rank] => 0
            [ID] => 482
            [run_id] => 20
            [user] => olegchynus22@gmail.com
            [first_name] => Олег
            [last_name] => Чунис
            [user_id] => 176
            [date] => 2016-08-20 10:00:01
            [time] => 59:59:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 1
            [is_volunteered] => 1
            [volunteer_position] => Scanning
            [runs] => 
            [personal_best] => 59:59:00
        )

)
Місце Ім’я Час Локація
1 Ростислав Карташов 16:18:00 Стрийський парк
2 Вадим Банков 16:35:00 Одеса: Парк Шевченка
3 Андрій Мартинюк 17:49:00 Тернопіль: Набережна ставу
4 Artem Slotin 18:04:00 Стрийський парк
5 микола трачук 19:10:00 Тернопіль: Набережна ставу
6 Сергій Сорокін 19:18:00 Труханів Острів, Київ
7 Roman Shp'yelyk 19:32:00 Стрийський парк
8 Олексій Степанов 19:34:00 Тернопіль: Набережна ставу
9 Петро Чернега 20:09:00 Стрийський парк
10 Volodymyr Khmelovskyi 20:19:00 Стрийський парк

Жінки

SELECT 
		result.event_place as rank, 
		result.ID, 
		run.ID as run_id, 
		user.display_name as user, 
		first_name.meta_value as first_name, 
		last_name.meta_value as last_name, 
		user.ID as user_id, 
		run.date as date, 
		result.time as time, 
		
		location_post.post_title as location_title, 
		location_post.guid as location_link, 
		location_post.ID as location_id,

		club_post.post_title as club_title,
		club_post.guid as club_link,

		volunteer.volunteered as volunteered,
		is_only_volunteered.value as is_only_volunteered,
		result.volunteered as is_volunteered,
		role.title as volunteer_position,

		runner.runs as runs,

		personal_best.value as personal_best

		FROM (SELECT res1.ID, max(res1.run_id) as run_id, res1.user_id, res1.event_place, res1.time, volunteered, volunteer_position
			FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 25
			            AND datediff(now(), meta_value) / 365.25 < 30
					)
				AND user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_sex'
			            AND meta_value = '2'
					)
				) AS res1
			INNER JOIN (
				SELECT user_id, min(time) as time
	            FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 25
			            AND datediff(now(), meta_value) / 365.25 < 30
					)
				AND user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_sex'
			            AND meta_value = '2'
					)
				) AS res3
	            GROUP BY user_id
				) as res2
			ON (res2.user_id = res1.user_id AND res1.time = res2.time)
			GROUP BY user_id
		) as result
		
		LEFT JOIN wp_runday_run as run
		ON result.run_id = run.ID
		
		LEFT JOIN wp_posts as location_post
		ON run.location_id = location_post.ID
		
		LEFT JOIN wp_users as user
		ON result.user_id = user.ID
		
		LEFT JOIN wp_usermeta as first_name
		ON first_name.user_id = user.ID
	    AND first_name.meta_key = 'first_name'
		
		LEFT JOIN wp_usermeta as last_name
		ON last_name.user_id = user.ID
	    AND last_name.meta_key = 'last_name'
		
		LEFT JOIN wp_usermeta as club
		ON club.user_id = user.ID
	    AND club.meta_key = 'club'
		
		LEFT JOIN wp_posts as club_post
		ON club.meta_value = club_post.post_name
		AND club.meta_value != ''
		AND club_post.post_type = 'runday_club'

		LEFT JOIN (
			SELECT user_id, MIN(volunteered) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as is_only_volunteered
		ON is_only_volunteered.user_id = user.ID

		LEFT JOIN (
			SELECT user_id, MIN(time) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as personal_best
		ON personal_best.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, SUM(volunteered) as volunteered
			FROM (
	            SELECT user_id, MAX(volunteered) AS volunteered
				FROM wp_runday_result
				GROUP BY run_id, user_id) as volunteered_per_run
			GROUP BY user_id
			) as volunteer
		ON volunteer.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, count(*) as runs
			FROM (
	            SELECT user_id
				FROM wp_runday_result
				WHERE volunteered = 0) as only_runs
			GROUP BY user_id
			) as runner
		ON runner.user_id = user.ID

		LEFT JOIN wp_runday_volunteer_positions  as role
		ON result.volunteer_position = role.ID

		WHERE 1 = 1
		 ORDER BY  time ASC, volunteered DESCArray
(
    [0] => stdClass Object
        (
            [rank] => 0
            [ID] => 1440
            [run_id] => 74
            [user] => fedorovaolen@mail.ru
            [first_name] => Олена
            [last_name] => Федорова
            [user_id] => 540
            [date] => 2016-11-26 13:55:23
            [time] => 19:19:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 6
            [personal_best] => 19:19:00
        )

    [1] => stdClass Object
        (
            [rank] => 0
            [ID] => 2355
            [run_id] => 125
            [user] => tetalviv@gmail.com
            [first_name] => Tetiana
            [last_name] => Danyliv
            [user_id] => 830
            [date] => 2017-03-04 21:55:09
            [time] => 22:14:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 8
            [personal_best] => 22:14:00
        )

    [2] => stdClass Object
        (
            [rank] => 0
            [ID] => 2216
            [run_id] => 118
            [user] => paucaverba@inbox.ru
            [first_name] => Надія
            [last_name] => Чумаченко
            [user_id] => 304
            [date] => 2017-02-25 10:06:51
            [time] => 22:58:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 22:58:00
        )

    [3] => stdClass Object
        (
            [rank] => 0
            [ID] => 946
            [run_id] => 48
            [user] => olesiavip@gmail.com
            [first_name] => Олеся
            [last_name] => Чайнюк
            [user_id] => 507
            [date] => 2016-10-15 10:04:16
            [time] => 23:50:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 23:50:00
        )

    [4] => stdClass Object
        (
            [rank] => 0
            [ID] => 190
            [run_id] => 15
            [user] => xDarynka
            [first_name] => Даша
            [last_name] => Сокольникова
            [user_id] => 3
            [date] => 2016-08-13 09:16:59
            [time] => 23:56:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => Veedoo
            [club_link] => http://runday.org/?post_type=runday_club&p=24647
            [volunteered] => 22
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 23:56:00
        )

    [5] => stdClass Object
        (
            [rank] => 0
            [ID] => 626
            [run_id] => 37
            [user] => perfekt-alla@yandex.ru
            [first_name] => Алла
            [last_name] => Бойко
            [user_id] => 94
            [date] => 2016-09-24 09:22:59
            [time] => 24:19:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 11
            [personal_best] => 24:19:00
        )

    [6] => stdClass Object
        (
            [rank] => 0
            [ID] => 3870
            [run_id] => 205
            [user] => victoriya.fadina@gmail.com
            [first_name] => Вікторія
            [last_name] => Фадіна
            [user_id] => 1161
            [date] => 2017-06-10 09:30:43
            [time] => 24:45:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 24:45:00
        )

    [7] => stdClass Object
        (
            [rank] => 0
            [ID] => 1121
            [run_id] => 57
            [user] => tekhanu@meta.ua
            [first_name] => Маріанна
            [last_name] => Янів
            [user_id] => 492
            [date] => 2016-10-29 09:56:09
            [time] => 24:46:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 24:46:00
        )

    [8] => stdClass Object
        (
            [rank] => 0
            [ID] => 611
            [run_id] => 36
            [user] => musindra26@mail.ru
            [first_name] => Valeria
            [last_name] => Samusieva
            [user_id] => 260
            [date] => 2016-09-24 09:21:50
            [time] => 24:56:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 2
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 6
            [personal_best] => 24:56:00
        )

    [9] => stdClass Object
        (
            [rank] => 0
            [ID] => 194
            [run_id] => 15
            [user] => vera.first.ivanova@gmail.com
            [first_name] => Віра
            [last_name] => Іванова
            [user_id] => 178
            [date] => 2016-08-13 09:16:59
            [time] => 25:02:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 25:02:00
        )

    [10] => stdClass Object
        (
            [rank] => 0
            [ID] => 523
            [run_id] => 32
            [user] => olena.helen@gmail.com
            [first_name] => Olena
            [last_name] => Bondarenko
            [user_id] => 375
            [date] => 2016-09-18 04:20:29
            [time] => 25:29:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 7
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 11
            [personal_best] => 25:29:00
        )

    [11] => stdClass Object
        (
            [rank] => 0
            [ID] => 1123
            [run_id] => 57
            [user] => annita.bonnita@mail.ru
            [first_name] => Анна
            [last_name] => Тименко
            [user_id] => 590
            [date] => 2016-10-29 09:56:09
            [time] => 26:03:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 26:03:00
        )

    [12] => stdClass Object
        (
            [rank] => 0
            [ID] => 1155
            [run_id] => 58
            [user] => sales1000viza@gmail.com
            [first_name] => Галина
            [last_name] => Береза
            [user_id] => 562
            [date] => 2016-11-05 09:26:08
            [time] => 26:40:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 26:40:00
        )

    [13] => stdClass Object
        (
            [rank] => 0
            [ID] => 199
            [run_id] => 15
            [user] => anna.strit@gmail.com
            [first_name] => Ганна
            [last_name] => Стретович
            [user_id] => 170
            [date] => 2016-08-13 09:16:59
            [time] => 26:57:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 26:57:00
        )

    [14] => stdClass Object
        (
            [rank] => 0
            [ID] => 1454
            [run_id] => 74
            [user] => Skorikovaolga27@gmail.com
            [first_name] => Оля
            [last_name] => Скорікова
            [user_id] => 654
            [date] => 2016-11-26 13:55:23
            [time] => 27:17:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 27:17:00
        )

    [15] => stdClass Object
        (
            [rank] => 0
            [ID] => 3032
            [run_id] => 153
            [user] => irena04bodrik@gmail.com
            [first_name] => Іра
            [last_name] => Бодрик
            [user_id] => 1025
            [date] => 2017-04-15 21:00:46
            [time] => 27:17:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 27:17:00
        )

    [16] => stdClass Object
        (
            [rank] => 0
            [ID] => 1510
            [run_id] => 77
            [user] => aliso4ka89@mail.ua
            [first_name] => Наталя
            [last_name] => Наталя
            [user_id] => 665
            [date] => 2016-12-03 09:05:10
            [time] => 27:40:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 8
            [personal_best] => 27:40:00
        )

    [17] => stdClass Object
        (
            [rank] => 0
            [ID] => 3497
            [run_id] => 183
            [user] => tarsekona@yandex.ru
            [first_name] => Svetlana
            [last_name] => Psaryuk
            [user_id] => 978
            [date] => 2017-05-13 07:14:15
            [time] => 27:49:00
            [location_title] => Одеса: Парк Шевченка
            [location_link] => https://runday.org/?post_type=runday_location&p=25771
            [location_id] => 25771
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 10
            [personal_best] => 27:49:00
        )

    [18] => stdClass Object
        (
            [rank] => 0
            [ID] => 1870
            [run_id] => 96
            [user] => diamant.anya@gmail.com
            [first_name] => Анна
            [last_name] => Діамант
            [user_id] => 812
            [date] => 2017-01-14 18:26:32
            [time] => 28:15:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 28:15:00
        )

    [19] => stdClass Object
        (
            [rank] => 0
            [ID] => 2172
            [run_id] => 115
            [user] => wiktoriya.luchka@gmail.com
            [first_name] => Вікторія
            [last_name] => Лучка
            [user_id] => 854
            [date] => 2017-02-18 23:09:16
            [time] => 28:19:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 28:19:00
        )

    [20] => stdClass Object
        (
            [rank] => 0
            [ID] => 201
            [run_id] => 15
            [user] => anastasie@veedoo.io
            [first_name] => Anastasia
            [last_name] => Ivanowsky
            [user_id] => 185
            [date] => 2016-08-13 09:16:59
            [time] => 28:35:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => Veedoo
            [club_link] => http://runday.org/?post_type=runday_club&p=24647
            [volunteered] => 1
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 28:35:00
        )

    [21] => stdClass Object
        (
            [rank] => 0
            [ID] => 1635
            [run_id] => 87
            [user] => marianamukutun11@mail.ru
            [first_name] => Мар'яна
            [last_name] => Бойко 
            [user_id] => 718
            [date] => 2016-12-24 10:51:38
            [time] => 28:40:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 28:40:00
        )

    [22] => stdClass Object
        (
            [rank] => 0
            [ID] => 204
            [run_id] => 15
            [user] => aerm2103@gmail.com
            [first_name] => Анастасія
            [last_name] => Єрмакова
            [user_id] => 182
            [date] => 2016-08-13 09:16:59
            [time] => 29:16:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 29:16:00
        )

    [23] => stdClass Object
        (
            [rank] => 0
            [ID] => 1976
            [run_id] => 103
            [user] => yulia.ryabko@gmail.com
            [first_name] => Юлія
            [last_name] => Рябко
            [user_id] => 834
            [date] => 2017-01-28 14:50:19
            [time] => 30:15:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 30:15:00
        )

    [24] => stdClass Object
        (
            [rank] => 0
            [ID] => 1128
            [run_id] => 57
            [user] => lighta92@mail.ru
            [first_name] => Світлана
            [last_name] => Сєдих
            [user_id] => 561
            [date] => 2016-10-29 09:56:09
            [time] => 30:19:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 30:19:00
        )

    [25] => stdClass Object
        (
            [rank] => 0
            [ID] => 1306
            [run_id] => 66
            [user] => radionenko.tatiana@gmail.com
            [first_name] => Таня
            [last_name] => Радионенко
            [user_id] => 630
            [date] => 2016-11-19 11:51:36
            [time] => 31:02:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 31:02:00
        )

    [26] => stdClass Object
        (
            [rank] => 0
            [ID] => 532
            [run_id] => 32
            [user] => smiledbp7@gmail.com
            [first_name] => Daria
            [last_name] => :-)
            [user_id] => 76
            [date] => 2016-09-18 04:20:29
            [time] => 31:19:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 3
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 6
            [personal_best] => 31:19:00
        )

    [27] => stdClass Object
        (
            [rank] => 0
            [ID] => 798
            [run_id] => 43
            [user] => o.gritsak@gmail.com
            [first_name] => Olga
            [last_name] => Grytsak
            [user_id] => 430
            [date] => 2016-10-01 12:24:56
            [time] => 31:23:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 31:23:00
        )

    [28] => stdClass Object
        (
            [rank] => 0
            [ID] => 614
            [run_id] => 36
            [user] => anna.striletska@gmail.com
            [first_name] => Anna
            [last_name] => STRILETSKA
            [user_id] => 399
            [date] => 2016-09-24 09:21:50
            [time] => 31:30:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 31:30:00
        )

    [29] => stdClass Object
        (
            [rank] => 0
            [ID] => 2223
            [run_id] => 118
            [user] => barskaya99@mail.ru
            [first_name] => Алла
            [last_name] => Барская 
            [user_id] => 874
            [date] => 2017-02-25 10:06:51
            [time] => 31:42:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 31:42:00
        )

    [30] => stdClass Object
        (
            [rank] => 9
            [ID] => 67
            [run_id] => 9
            [user] => ella.vasilevsakaya@gmail.com
            [first_name] => Елла
            [last_name] => Василевська
            [user_id] => 139
            [date] => 2016-08-06 08:45:46
            [time] => 31:47:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 31:47:00
        )

    [31] => stdClass Object
        (
            [rank] => 0
            [ID] => 1095
            [run_id] => 56
            [user] => annachorna@ukr.net
            [first_name] =>  Анна
            [last_name] => Чорна
            [user_id] => 582
            [date] => 2016-10-29 09:09:06
            [time] => 32:25:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 32:25:00
        )

    [32] => stdClass Object
        (
            [rank] => 0
            [ID] => 2382
            [run_id] => 125
            [user] => bodjanochka2@gmail.com
            [first_name] => Богдана
            [last_name] => Дутко
            [user_id] => 907
            [date] => 2017-03-04 21:55:09
            [time] => 34:10:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 34:10:00
        )

    [33] => stdClass Object
        (
            [rank] => 0
            [ID] => 430
            [run_id] => 227
            [user] => alena.lashshenko199215@gmail.com
            [first_name] => Альона 
            [last_name] => Лащенко 
            [user_id] => 287
            [date] => 2017-07-01 12:06:08
            [time] => 59:59:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 30
            [is_only_volunteered] => 1
            [is_volunteered] => 1
            [volunteer_position] => Tokens
            [runs] => 
            [personal_best] => 59:59:00
        )

    [34] => stdClass Object
        (
            [rank] => 0
            [ID] => 2211
            [run_id] => 220
            [user] => olgazaporozhets@yahoo.com
            [first_name] => Olga
            [last_name] => Zaporozhets
            [user_id] => 861
            [date] => 2017-06-24 17:39:33
            [time] => 59:59:00
            [location_title] => Одеса: Парк Шевченка
            [location_link] => https://runday.org/?post_type=runday_location&p=25771
            [location_id] => 25771
            [club_title] => 
            [club_link] => 
            [volunteered] => 6
            [is_only_volunteered] => 1
            [is_volunteered] => 1
            [volunteer_position] => Timekeeper
            [runs] => 
            [personal_best] => 59:59:00
        )

    [35] => stdClass Object
        (
            [rank] => 0
            [ID] => 421
            [run_id] => 18
            [user] => lyuda.dovgan@gmail.com
            [first_name] => Liudmyla
            [last_name] => Dovgan
            [user_id] => 84
            [date] => 2016-08-20 07:28:01
            [time] => 59:59:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 2
            [is_only_volunteered] => 1
            [is_volunteered] => 1
            [volunteer_position] => Tokens
            [runs] => 
            [personal_best] => 59:59:00
        )

    [36] => stdClass Object
        (
            [rank] => 0
            [ID] => 962
            [run_id] => 49
            [user] => opiopchenko@gmail.com
            [first_name] => Tetiana
            [last_name] => Opiopchenko
            [user_id] => 65
            [date] => 2016-10-22 09:11:07
            [time] => 59:59:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 1
            [is_volunteered] => 1
            [volunteer_position] => Warm-Up/Down
            [runs] => 
            [personal_best] => 59:59:00
        )

)
Місце Ім’я Час Локація
1 Олена Федорова 19:19:00 Стрийський парк
2 Tetiana Danyliv 22:14:00 Стрийський парк
3 Надія Чумаченко 22:58:00 Труханів Острів, Київ
4 Олеся Чайнюк 23:50:00 Тернопіль: Набережна ставу
5 Даша Сокольникова 23:56:00 Труханів Острів, Київ
6 Алла Бойко 24:19:00 Труханів Острів, Київ
7 Вікторія Фадіна 24:45:00 Стрийський парк
8 Маріанна Янів 24:46:00 Стрийський парк
9 Valeria Samusieva 24:56:00 Стрийський парк
10 Віра Іванова 25:02:00 Труханів Острів, Київ

30-34.

Топ – 10

SELECT 
		result.event_place as rank, 
		result.ID, 
		run.ID as run_id, 
		user.display_name as user, 
		first_name.meta_value as first_name, 
		last_name.meta_value as last_name, 
		user.ID as user_id, 
		run.date as date, 
		result.time as time, 
		
		location_post.post_title as location_title, 
		location_post.guid as location_link, 
		location_post.ID as location_id,

		club_post.post_title as club_title,
		club_post.guid as club_link,

		volunteer.volunteered as volunteered,
		is_only_volunteered.value as is_only_volunteered,
		result.volunteered as is_volunteered,
		role.title as volunteer_position,

		runner.runs as runs,

		personal_best.value as personal_best

		FROM (SELECT res1.ID, max(res1.run_id) as run_id, res1.user_id, res1.event_place, res1.time, volunteered, volunteer_position
			FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 30
			            AND datediff(now(), meta_value) / 365.25 < 35
					)
				
				) AS res1
			INNER JOIN (
				SELECT user_id, min(time) as time
	            FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 30
			            AND datediff(now(), meta_value) / 365.25 < 35
					)
				
				) AS res3
	            GROUP BY user_id
				) as res2
			ON (res2.user_id = res1.user_id AND res1.time = res2.time)
			GROUP BY user_id
		) as result
		
		LEFT JOIN wp_runday_run as run
		ON result.run_id = run.ID
		
		LEFT JOIN wp_posts as location_post
		ON run.location_id = location_post.ID
		
		LEFT JOIN wp_users as user
		ON result.user_id = user.ID
		
		LEFT JOIN wp_usermeta as first_name
		ON first_name.user_id = user.ID
	    AND first_name.meta_key = 'first_name'
		
		LEFT JOIN wp_usermeta as last_name
		ON last_name.user_id = user.ID
	    AND last_name.meta_key = 'last_name'
		
		LEFT JOIN wp_usermeta as club
		ON club.user_id = user.ID
	    AND club.meta_key = 'club'
		
		LEFT JOIN wp_posts as club_post
		ON club.meta_value = club_post.post_name
		AND club.meta_value != ''
		AND club_post.post_type = 'runday_club'

		LEFT JOIN (
			SELECT user_id, MIN(volunteered) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as is_only_volunteered
		ON is_only_volunteered.user_id = user.ID

		LEFT JOIN (
			SELECT user_id, MIN(time) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as personal_best
		ON personal_best.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, SUM(volunteered) as volunteered
			FROM (
	            SELECT user_id, MAX(volunteered) AS volunteered
				FROM wp_runday_result
				GROUP BY run_id, user_id) as volunteered_per_run
			GROUP BY user_id
			) as volunteer
		ON volunteer.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, count(*) as runs
			FROM (
	            SELECT user_id
				FROM wp_runday_result
				WHERE volunteered = 0) as only_runs
			GROUP BY user_id
			) as runner
		ON runner.user_id = user.ID

		LEFT JOIN wp_runday_volunteer_positions  as role
		ON result.volunteer_position = role.ID

		WHERE 1 = 1
		 ORDER BY  time ASC, volunteered DESCArray
(
    [0] => stdClass Object
        (
            [rank] => 0
            [ID] => 1102
            [run_id] => 57
            [user] => l106itelsport@mail.ru
            [first_name] => Володимир
            [last_name] => Ханас
            [user_id] => 288
            [date] => 2016-10-29 09:56:09
            [time] => 16:31:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 26
            [personal_best] => 16:31:00
        )

    [1] => stdClass Object
        (
            [rank] => 0
            [ID] => 3920
            [run_id] => 208
            [user] => babychdunkan@gmail.com
            [first_name] => Сергій
            [last_name] => Бабич
            [user_id] => 542
            [date] => 2017-06-10 09:27:12
            [time] => 16:54:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 14
            [personal_best] => 16:54:00
        )

    [2] => stdClass Object
        (
            [rank] => 0
            [ID] => 2389
            [run_id] => 126
            [user] => dovbushro@ukr.net
            [first_name] => Роман
            [last_name] => Довбуш
            [user_id] => 321
            [date] => 2017-03-11 21:34:33
            [time] => 18:02:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 9
            [personal_best] => 18:02:00
        )

    [3] => stdClass Object
        (
            [rank] => 0
            [ID] => 4345
            [run_id] => 241
            [user] => 2133390@gmail.com
            [first_name] => Северин
            [last_name] => Наливайко
            [user_id] => 897
            [date] => 2017-07-08 20:02:59
            [time] => 18:40:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 15
            [personal_best] => 18:40:00
        )

    [4] => stdClass Object
        (
            [rank] => 0
            [ID] => 2472
            [run_id] => 131
            [user] => c_ultra@ukr.net
            [first_name] => Ярослав 
            [last_name] => Кондюх
            [user_id] => 254
            [date] => 2017-03-18 16:25:20
            [time] => 19:12:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 19:12:00
        )

    [5] => stdClass Object
        (
            [rank] => 0
            [ID] => 4453
            [run_id] => 247
            [user] => kochurovskyi.y@gmail.com
            [first_name] => Yuriy
            [last_name] => Kochurovskyi
            [user_id] => 1324
            [date] => 2017-07-15 08:02:11
            [time] => 19:16:00
            [location_title] => Одеса: Парк Шевченка
            [location_link] => https://runday.org/?post_type=runday_location&p=25771
            [location_id] => 25771
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 8
            [personal_best] => 19:16:00
        )

    [6] => stdClass Object
        (
            [rank] => 0
            [ID] => 1266
            [run_id] => 65
            [user] => servisestkontakt@gmail.com
            [first_name] => Андрій
            [last_name] => Куксовський
            [user_id] => 593
            [date] => 2016-11-12 11:09:02
            [time] => 19:21:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 19:21:00
        )

    [7] => stdClass Object
        (
            [rank] => 0
            [ID] => 2954
            [run_id] => 148
            [user] => gromiak1109@gmail.com
            [first_name] => Саша
            [last_name] => Гром'як
            [user_id] => 632
            [date] => 2017-04-08 11:25:39
            [time] => 19:21:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 7
            [personal_best] => 19:21:00
        )

    [8] => stdClass Object
        (
            [rank] => 0
            [ID] => 4418
            [run_id] => 245
            [user] => andriymoysey@gmail.com
            [first_name] => Андрій
            [last_name] => Мойсей
            [user_id] => 875
            [date] => 2017-07-15 15:13:30
            [time] => 19:30:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 11
            [personal_best] => 19:30:00
        )

    [9] => stdClass Object
        (
            [rank] => 0
            [ID] => 2664
            [run_id] => 139
            [user] => cerbuha@ukr.net
            [first_name] => Євген
            [last_name] => Резніченко
            [user_id] => 485
            [date] => 2017-04-01 09:59:57
            [time] => 19:36:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 22
            [personal_best] => 19:36:00
        )

    [10] => stdClass Object
        (
            [rank] => 0
            [ID] => 2391
            [run_id] => 126
            [user] => turenko@me.com
            [first_name] => Yaroslav
            [last_name] => Turenko
            [user_id] => 798
            [date] => 2017-03-11 21:34:33
            [time] => 19:43:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 7
            [personal_best] => 19:43:00
        )

    [11] => stdClass Object
        (
            [rank] => 0
            [ID] => 2925
            [run_id] => 147
            [user] => d.degtiarov@gmail.com
            [first_name] => Дмитро
            [last_name] => Дегтярьов
            [user_id] => 931
            [date] => 2017-04-08 10:45:19
            [time] => 19:55:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 19:55:00
        )

    [12] => stdClass Object
        (
            [rank] => 0
            [ID] => 3660
            [run_id] => 194
            [user] => serg1o@ukr.net
            [first_name] => Сергій
            [last_name] => Іваненко
            [user_id] => 445
            [date] => 2017-05-27 15:09:38
            [time] => 20:07:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 24
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 15
            [personal_best] => 20:07:00
        )

    [13] => stdClass Object
        (
            [rank] => 0
            [ID] => 1692
            [run_id] => 89
            [user] => savrick21@gmail.com
            [first_name] => Роман
            [last_name] => Саворона
            [user_id] => 757
            [date] => 2016-12-31 11:47:21
            [time] => 20:07:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 20:07:00
        )

    [14] => stdClass Object
        (
            [rank] => 0
            [ID] => 1269
            [run_id] => 65
            [user] => Jarema.kit@gmail.com
            [first_name] => Ярема
            [last_name] => Кіт
            [user_id] => 320
            [date] => 2016-11-12 11:09:02
            [time] => 20:08:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 12
            [personal_best] => 20:08:00
        )

    [15] => stdClass Object
        (
            [rank] => 0
            [ID] => 4399
            [run_id] => 244
            [user] => andriiusatenko@gmail.com
            [first_name] => Андрій
            [last_name] => Усатенко
            [user_id] => 179
            [date] => 2017-07-15 15:08:14
            [time] => 20:15:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 6
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 44
            [personal_best] => 20:15:00
        )

    [16] => stdClass Object
        (
            [rank] => 0
            [ID] => 771
            [run_id] => 43
            [user] => Sadavan87@gmail.com
            [first_name] => Ігор
            [last_name] => Пилипівський 
            [user_id] => 440
            [date] => 2016-10-01 12:24:56
            [time] => 20:17:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 20:17:00
        )

    [17] => stdClass Object
        (
            [rank] => 0
            [ID] => 917
            [run_id] => 47
            [user] => peter.martynov@gmail.com
            [first_name] => Петро
            [last_name] => Мартинов
            [user_id] => 160
            [date] => 2016-10-15 08:02:51
            [time] => 20:18:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 26
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 9
            [personal_best] => 20:18:00
        )

    [18] => stdClass Object
        (
            [rank] => 0
            [ID] => 1106
            [run_id] => 57
            [user] => lutsyshyn@ukr.net
            [first_name] => Юрій
            [last_name] => Луцишин
            [user_id] => 296
            [date] => 2016-10-29 09:56:09
            [time] => 20:19:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 20:19:00
        )

    [19] => stdClass Object
        (
            [rank] => 0
            [ID] => 2559
            [run_id] => 135
            [user] => annshevchuk@gmail.com
            [first_name] => Анна
            [last_name] => Шевчук
            [user_id] => 374
            [date] => 2017-03-25 00:04:03
            [time] => 20:31:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 20:31:00
        )

    [20] => stdClass Object
        (
            [rank] => 0
            [ID] => 1168
            [run_id] => 59
            [user] => usatenko@gmail.com
            [first_name] => Oleksii
            [last_name] => Usatenko
            [user_id] => 175
            [date] => 2016-11-05 09:30:05
            [time] => 20:32:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 5
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 31
            [personal_best] => 20:32:00
        )

    [21] => stdClass Object
        (
            [rank] => 0
            [ID] => 1108
            [run_id] => 57
            [user] => yiprokopchuk@meta.ua
            [first_name] => Yarema
            [last_name] => Prokopchuk
            [user_id] => 259
            [date] => 2016-10-29 09:56:09
            [time] => 20:33:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 20:33:00
        )

    [22] => stdClass Object
        (
            [rank] => 0
            [ID] => 3831
            [run_id] => 204
            [user] => vasylletsyn@gmail.com
            [first_name] => Vasyl
            [last_name] => Letsyn
            [user_id] => 1328
            [date] => 2017-06-10 08:22:09
            [time] => 20:34:00
            [location_title] => Франківськ: Міське озеро 
            [location_link] => https://runday.org/?post_type=runday_location&p=25930
            [location_id] => 25930
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 20:34:00
        )

    [23] => stdClass Object
        (
            [rank] => 0
            [ID] => 390
            [run_id] => 28
            [user] => znack@mail.ru
            [first_name] => Nazar
            [last_name] => Znak
            [user_id] => 356
            [date] => 2016-09-10 13:55:40
            [time] => 21:08:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 21:08:00
        )

    [24] => stdClass Object
        (
            [rank] => 0
            [ID] => 1141
            [run_id] => 58
            [user] => sergbylaa@gmail.com
            [first_name] => Сергій
            [last_name] => Болюк
            [user_id] => 560
            [date] => 2016-11-05 09:26:08
            [time] => 21:13:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 21:13:00
        )

    [25] => stdClass Object
        (
            [rank] => 0
            [ID] => 3927
            [run_id] => 208
            [user] => g0955259669@gmail.com
            [first_name] => Дмитро
            [last_name] => Загородній
            [user_id] => 880
            [date] => 2017-06-10 09:27:12
            [time] => 21:15:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 7
            [personal_best] => 21:15:00
        )

    [26] => stdClass Object
        (
            [rank] => 0
            [ID] => 3928
            [run_id] => 208
            [user] => ruzhytskyi@gmail.com
            [first_name] => Олександр
            [last_name] => Ружицький
            [user_id] => 8
            [date] => 2017-06-10 09:27:12
            [time] => 21:18:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => Everlegal
            [club_link] => https://runday.org/?post_type=runday_club&p=24717
            [volunteered] => 13
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 34
            [personal_best] => 21:18:00
        )

    [27] => stdClass Object
        (
            [rank] => 0
            [ID] => 1275
            [run_id] => 65
            [user] => nfstage@gmail.com
            [first_name] => Fred 
            [last_name] => Erik
            [user_id] => 611
            [date] => 2016-11-12 11:09:02
            [time] => 21:23:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 21:23:00
        )

    [28] => stdClass Object
        (
            [rank] => 0
            [ID] => 320
            [run_id] => 22
            [user] => 777mykola@gmail.com
            [first_name] => Микола
            [last_name] => Кур'янов
            [user_id] => 91
            [date] => 2016-08-27 11:09:06
            [time] => 21:26:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 5
            [personal_best] => 21:26:00
        )

    [29] => stdClass Object
        (
            [rank] => 0
            [ID] => 606
            [run_id] => 36
            [user] => maxim.onufrienko@gmail.com
            [first_name] => Максим
            [last_name] => Онуфрієнко
            [user_id] => 397
            [date] => 2016-09-24 09:21:50
            [time] => 21:48:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 21:48:00
        )

    [30] => stdClass Object
        (
            [rank] => 0
            [ID] => 3860
            [run_id] => 205
            [user] => branovska82@mail.ru
            [first_name] => Галина
            [last_name] => Брановська 
            [user_id] => 341
            [date] => 2017-06-10 09:30:43
            [time] => 22:07:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 17
            [personal_best] => 22:07:00
        )

    [31] => stdClass Object
        (
            [rank] => 0
            [ID] => 940
            [run_id] => 48
            [user] => olhalola@yahoo.com
            [first_name] => Ольга
            [last_name] => Лола
            [user_id] => 490
            [date] => 2016-10-15 10:04:16
            [time] => 22:08:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 3
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 8
            [personal_best] => 22:08:00
        )

    [32] => stdClass Object
        (
            [rank] => 0
            [ID] => 4434
            [run_id] => 246
            [user] => ryslik@gmail.com
            [first_name] => Руслан
            [last_name] => Ружицький
            [user_id] => 193
            [date] => 2017-07-15 15:14:58
            [time] => 22:14:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 17
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 16
            [personal_best] => 22:14:00
        )

    [33] => stdClass Object
        (
            [rank] => 0
            [ID] => 3766
            [run_id] => 201
            [user] => tws.zp.ua@gmail.com
            [first_name] => Андрей
            [last_name] => Сидоренко
            [user_id] => 786
            [date] => 2017-06-03 18:58:26
            [time] => 22:19:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 10
            [personal_best] => 22:19:00
        )

    [34] => stdClass Object
        (
            [rank] => 0
            [ID] => 775
            [run_id] => 43
            [user] => o.onyschenko@gmail.com
            [first_name] => Олексій
            [last_name] => Онищенко
            [user_id] => 409
            [date] => 2016-10-01 12:24:56
            [time] => 22:23:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 22:23:00
        )

    [35] => stdClass Object
        (
            [rank] => 0
            [ID] => 3304
            [run_id] => 173
            [user] => ramina-d@yandex.ru
            [first_name] => Ramina 
            [last_name] => Dadasheva
            [user_id] => 789
            [date] => 2017-05-06 08:30:16
            [time] => 22:24:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 22:24:00
        )

    [36] => stdClass Object
        (
            [rank] => 0
            [ID] => 655
            [run_id] => 38
            [user] => nazar.stetsyk@gmail.com
            [first_name] => Назарій
            [last_name] => Стецик
            [user_id] => 395
            [date] => 2016-10-01 09:22:43
            [time] => 22:35:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 22:35:00
        )

    [37] => stdClass Object
        (
            [rank] => 0
            [ID] => 291
            [run_id] => 20
            [user] => viktor.zvarych@gmail.com
            [first_name] => Віктор
            [last_name] => Зварич
            [user_id] => 238
            [date] => 2016-08-20 10:00:01
            [time] => 22:49:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 22:49:00
        )

    [38] => stdClass Object
        (
            [rank] => 0
            [ID] => 1790
            [run_id] => 91
            [user] => romko.fm@gmail.com
            [first_name] => Ромко
            [last_name] => Задорожний
            [user_id] => 651
            [date] => 2016-12-31 12:07:43
            [time] => 22:54:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 6
            [personal_best] => 22:54:00
        )

    [39] => stdClass Object
        (
            [rank] => 0
            [ID] => 2405
            [run_id] => 126
            [user] => Greenb@ukr.net
            [first_name] => Роман
            [last_name] => Петренко
            [user_id] => 770
            [date] => 2017-03-11 21:34:33
            [time] => 23:01:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 23:01:00
        )

    [40] => stdClass Object
        (
            [rank] => 0
            [ID] => 1705
            [run_id] => 94
            [user] => post_asu@mail.ru
            [first_name] => Микола
            [last_name] => Жуков 
            [user_id] => 51
            [date] => 2017-01-07 17:54:37
            [time] => 23:05:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 23:05:00
        )

    [41] => stdClass Object
        (
            [rank] => 0
            [ID] => 3562
            [run_id] => 188
            [user] => Shuma_s@bigmir.net
            [first_name] => Сергій
            [last_name] => Шумега
            [user_id] => 1465
            [date] => 2017-05-20 19:52:32
            [time] => 23:06:00
            [location_title] => Франківськ: Міське озеро 
            [location_link] => https://runday.org/?post_type=runday_location&p=25930
            [location_id] => 25930
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 23:06:00
        )

    [42] => stdClass Object
        (
            [rank] => 0
            [ID] => 1706
            [run_id] => 89
            [user] => alexluba22@rambler.ru
            [first_name] => Олександр
            [last_name] => Либа
            [user_id] => 794
            [date] => 2016-12-31 11:47:21
            [time] => 23:09:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 23:09:00
        )

    [43] => stdClass Object
        (
            [rank] => 0
            [ID] => 2780
            [run_id] => 142
            [user] => Goodviniha@gmail.com
            [first_name] => Вікторія
            [last_name] => Бондаренко
            [user_id] => 1074
            [date] => 2017-04-01 11:57:35
            [time] => 23:20:00
            [location_title] => Одеса: Парк Шевченка
            [location_link] => https://runday.org/?post_type=runday_location&p=25771
            [location_id] => 25771
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 23:20:00
        )

    [44] => stdClass Object
        (
            [rank] => 0
            [ID] => 517
            [run_id] => 32
            [user] => maksym.bil@gmail.com
            [first_name] => Макс
            [last_name] => Біляєвський
            [user_id] => 89
            [date] => 2016-09-18 04:20:29
            [time] => 23:29:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 23:29:00
        )

    [45] => stdClass Object
        (
            [rank] => 0
            [ID] => 924
            [run_id] => 47
            [user] => Yevhen
            [first_name] => Yevhen
            [last_name] => Kuzyk
            [user_id] => 25
            [date] => 2016-10-15 08:02:51
            [time] => 23:40:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 3
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 15
            [personal_best] => 23:40:00
        )

    [46] => stdClass Object
        (
            [rank] => 0
            [ID] => 1708
            [run_id] => 89
            [user] => sergey.spivak@gmail.com
            [first_name] => СЕРГІЙ
            [last_name] => СПІВАК
            [user_id] => 736
            [date] => 2016-12-31 11:47:21
            [time] => 23:47:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 23:47:00
        )

    [47] => stdClass Object
        (
            [rank] => 0
            [ID] => 3866
            [run_id] => 205
            [user] => tararasik@gmail.com
            [first_name] => Тарас
            [last_name] => Войтович
            [user_id] => 220
            [date] => 2017-06-10 09:30:43
            [time] => 23:58:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 23:58:00
        )

    [48] => stdClass Object
        (
            [rank] => 0
            [ID] => 4441
            [run_id] => 246
            [user] => shpakdmitriy@gmail.com
            [first_name] => Дмитро
            [last_name] => Шпак
            [user_id] => 244
            [date] => 2017-07-15 15:14:58
            [time] => 24:05:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 22
            [personal_best] => 24:05:00
        )

    [49] => stdClass Object
        (
            [rank] => 0
            [ID] => 2407
            [run_id] => 126
            [user] => Ramule@i.ua
            [first_name] => Дарія
            [last_name] => Боднар
            [user_id] => 788
            [date] => 2017-03-11 21:34:33
            [time] => 24:05:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 24:05:00
        )

    [50] => stdClass Object
        (
            [rank] => 0
            [ID] => 1286
            [run_id] => 65
            [user] => kulchik30@gmail.com
            [first_name] => Юра
            [last_name] => Кульчик
            [user_id] => 614
            [date] => 2016-11-12 11:09:02
            [time] => 24:34:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 24:34:00
        )

    [51] => stdClass Object
        (
            [rank] => 0
            [ID] => 627
            [run_id] => 37
            [user] => babichnataliia@gmail.com
            [first_name] => Наталия
            [last_name] => Бабич
            [user_id] => 171
            [date] => 2016-09-24 09:22:59
            [time] => 24:36:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 11
            [personal_best] => 24:36:00
        )

    [52] => stdClass Object
        (
            [rank] => 0
            [ID] => 1943
            [run_id] => 101
            [user] => romavrv@gmail.com
            [first_name] => Роман
            [last_name] => Вижиковський
            [user_id] => 652
            [date] => 2017-01-28 14:14:01
            [time] => 24:40:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 6
            [personal_best] => 24:40:00
        )

    [53] => stdClass Object
        (
            [rank] => 0
            [ID] => 1120
            [run_id] => 57
            [user] => vovandos@gmail.com
            [first_name] => Володимир
            [last_name] => Врублевський
            [user_id] => 271
            [date] => 2016-10-29 09:56:09
            [time] => 24:43:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 12
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 24:43:00
        )

    [54] => stdClass Object
        (
            [rank] => 0
            [ID] => 293
            [run_id] => 20
            [user] => az@ruhomi.com
            [first_name] => Андрій
            [last_name] => Звірко
            [user_id] => 242
            [date] => 2016-08-20 10:00:01
            [time] => 24:49:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 24:49:00
        )

    [55] => stdClass Object
        (
            [rank] => 0
            [ID] => 954
            [run_id] => 48
            [user] => vitaxa2007@rambler.ru
            [first_name] => Павло
            [last_name] => Хрущов
            [user_id] => 539
            [date] => 2016-10-15 10:04:16
            [time] => 24:54:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 24:54:00
        )

    [56] => stdClass Object
        (
            [rank] => 0
            [ID] => 3844
            [run_id] => 204
            [user] => andriy1215@mail.ru
            [first_name] => Андрій
            [last_name] => Пришляк
            [user_id] => 1263
            [date] => 2017-06-10 08:22:09
            [time] => 24:59:00
            [location_title] => Франківськ: Міське озеро 
            [location_link] => https://runday.org/?post_type=runday_location&p=25930
            [location_id] => 25930
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 24:59:00
        )

    [57] => stdClass Object
        (
            [rank] => 0
            [ID] => 612
            [run_id] => 36
            [user] => invisible.cd@gmail.com
            [first_name] => Денис
            [last_name] => Черевко
            [user_id] => 346
            [date] => 2016-09-24 09:21:50
            [time] => 25:05:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 6
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 11
            [personal_best] => 25:05:00
        )

    [58] => stdClass Object
        (
            [rank] => 0
            [ID] => 1712
            [run_id] => 89
            [user] => andorra07@i.ua
            [first_name] => Ірина
            [last_name] => Черной
            [user_id] => 742
            [date] => 2016-12-31 11:47:21
            [time] => 25:14:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 25:14:00
        )

    [59] => stdClass Object
        (
            [rank] => 0
            [ID] => 3367
            [run_id] => 177
            [user] => larson05@list.ru
            [first_name] => Алексей
            [last_name] => Парфёнов
            [user_id] => 1370
            [date] => 2017-05-06 08:25:40
            [time] => 25:18:00
            [location_title] => Одеса: Парк Шевченка
            [location_link] => https://runday.org/?post_type=runday_location&p=25771
            [location_id] => 25771
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 25:18:00
        )

    [60] => stdClass Object
        (
            [rank] => 0
            [ID] => 1713
            [run_id] => 89
            [user] => gerda0283@gmail.com
            [first_name] => Даша
            [last_name] => Гермаш
            [user_id] => 787
            [date] => 2016-12-31 11:47:21
            [time] => 25:21:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 25:21:00
        )

    [61] => stdClass Object
        (
            [rank] => 0
            [ID] => 864
            [run_id] => 44
            [user] => ovcharenko_m83@mail.ru
            [first_name] => Ovcharenko
            [last_name] => Mykhailo
            [user_id] => 401
            [date] => 2016-10-08 09:04:10
            [time] => 25:30:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 25:30:00
        )

    [62] => stdClass Object
        (
            [rank] => 0
            [ID] => 408
            [run_id] => 29
            [user] => kravetsin@gmail.com
            [first_name] => Inna
            [last_name] => Kravets
            [user_id] => 191
            [date] => 2016-09-10 14:00:39
            [time] => 25:50:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 2
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 5
            [personal_best] => 25:50:00
        )

    [63] => stdClass Object
        (
            [rank] => 0
            [ID] => 2112
            [run_id] => 111
            [user] => m.a.osipov@gmail.com
            [first_name] =>  Марія 
            [last_name] => 
            [user_id] => 69
            [date] => 2017-02-11 11:57:34
            [time] => 25:51:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 25:51:00
        )

    [64] => stdClass Object
        (
            [rank] => 0
            [ID] => 1864
            [run_id] => 96
            [user] => dimag999@hotmail.com
            [first_name] => Dmitriy
            [last_name] => Gaistruk
            [user_id] => 820
            [date] => 2017-01-14 18:26:32
            [time] => 26:13:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 26:13:00
        )

    [65] => stdClass Object
        (
            [rank] => 0
            [ID] => 1886
            [run_id] => 97
            [user] => maks@webakcent.pro
            [first_name] => Максим
            [last_name] => Слободянюк
            [user_id] => 808
            [date] => 2017-01-14 18:34:23
            [time] => 26:26:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 26:26:00
        )

    [66] => stdClass Object
        (
            [rank] => 0
            [ID] => 4406
            [run_id] => 244
            [user] => sergeygt@meta.ua
            [first_name] => Сергей
            [last_name] => Евсюков
            [user_id] => 892
            [date] => 2017-07-15 15:08:14
            [time] => 26:30:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 26:30:00
        )

    [67] => stdClass Object
        (
            [rank] => 0
            [ID] => 409
            [run_id] => 29
            [user] => olena.zatynatska@gmail.com
            [first_name] => Olena
            [last_name] => Zatynatska
            [user_id] => 144
            [date] => 2016-09-10 14:00:39
            [time] => 26:32:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 26:32:00
        )

    [68] => stdClass Object
        (
            [rank] => 0
            [ID] => 198
            [run_id] => 15
            [user] => snipps0233@gmail.com
            [first_name] => Samuel
            [last_name] => Adegoke
            [user_id] => 7
            [date] => 2016-08-13 09:16:59
            [time] => 26:35:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => Veedoo
            [club_link] => http://runday.org/?post_type=runday_club&p=24647
            [volunteered] => 2
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 26:35:00
        )

    [69] => stdClass Object
        (
            [rank] => 0
            [ID] => 1867
            [run_id] => 96
            [user] => o.kucheriavyi@gmail.com
            [first_name] => Oleksandr
            [last_name] => Kucheriavyi
            [user_id] => 819
            [date] => 2017-01-14 18:26:32
            [time] => 26:37:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 26:37:00
        )

    [70] => stdClass Object
        (
            [rank] => 0
            [ID] => 3954
            [run_id] => 210
            [user] => bilazoya@gmail.com
            [first_name] => Зоя
            [last_name] => Біла
            [user_id] => 1114
            [date] => 2017-06-17 14:17:43
            [time] => 26:43:00
            [location_title] => Одеса: Парк Шевченка
            [location_link] => https://runday.org/?post_type=runday_location&p=25771
            [location_id] => 25771
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 10
            [personal_best] => 26:43:00
        )

    [71] => stdClass Object
        (
            [rank] => 0
            [ID] => 786
            [run_id] => 43
            [user] => kvitokslava@ukr.net
            [first_name] => Катя
            [last_name] => Луцька
            [user_id] => 328
            [date] => 2016-10-01 12:24:56
            [time] => 26:48:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 26:48:00
        )

    [72] => stdClass Object
        (
            [rank] => 0
            [ID] => 1239
            [run_id] => 63
            [user] => tanyamis-ch@ukr.net
            [first_name] => Тетяна
            [last_name] => Міськевич
            [user_id] => 559
            [date] => 2016-11-12 11:47:42
            [time] => 27:03:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 27:03:00
        )

    [73] => stdClass Object
        (
            [rank] => 0
            [ID] => 1718
            [run_id] => 89
            [user] => guziy.ua@gmail.com
            [first_name] => Vasyl
            [last_name] => Huziy
            [user_id] => 756
            [date] => 2016-12-31 11:47:21
            [time] => 27:11:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 27:11:00
        )

    [74] => stdClass Object
        (
            [rank] => 0
            [ID] => 1719
            [run_id] => 89
            [user] => tigressap@gmail.com
            [first_name] => Альона
            [last_name] => Печерна
            [user_id] => 781
            [date] => 2016-12-31 11:47:21
            [time] => 27:18:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 27:18:00
        )

    [75] => stdClass Object
        (
            [rank] => 0
            [ID] => 2219
            [run_id] => 118
            [user] => thanku4love@gmail.com
            [first_name] => Костянтин
            [last_name] => Салов
            [user_id] => 384
            [date] => 2017-02-25 10:06:51
            [time] => 27:19:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 27:19:00
        )

    [76] => stdClass Object
        (
            [rank] => 0
            [ID] => 3879
            [run_id] => 205
            [user] => kklymko@vodafone.ua
            [first_name] => Катерина
            [last_name] => Климко
            [user_id] => 1532
            [date] => 2017-06-10 09:30:43
            [time] => 28:01:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 28:01:00
        )

    [77] => stdClass Object
        (
            [rank] => 0
            [ID] => 527
            [run_id] => 32
            [user] => di.kondratyeva@gmail.com
            [first_name] => Diana
            [last_name] => Kondratieva
            [user_id] => 295
            [date] => 2016-09-18 04:20:29
            [time] => 28:05:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 28:05:00
        )

    [78] => stdClass Object
        (
            [rank] => 0
            [ID] => 1125
            [run_id] => 57
            [user] => voznjuk-andriy@ukr.net
            [first_name] => Андрій
            [last_name] => Вознюк
            [user_id] => 578
            [date] => 2016-10-29 09:56:09
            [time] => 28:13:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 4
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 28:13:00
        )

    [79] => stdClass Object
        (
            [rank] => 0
            [ID] => 2501
            [run_id] => 131
            [user] => varshone@gmail.com
            [first_name] => Орест
            [last_name] => Гладун
            [user_id] => 369
            [date] => 2017-03-18 16:25:20
            [time] => 28:17:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 28:17:00
        )

    [80] => stdClass Object
        (
            [rank] => 0
            [ID] => 2100
            [run_id] => 110
            [user] => sviat3@gmail.com
            [first_name] => Святослав 
            [last_name] => Абрам'юк
            [user_id] => 707
            [date] => 2017-02-11 18:10:42
            [time] => 28:34:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 5
            [personal_best] => 28:34:00
        )

    [81] => stdClass Object
        (
            [rank] => 0
            [ID] => 874
            [run_id] => 44
            [user] => salenka1@yandex.ru
            [first_name] => Olena
            [last_name] => Bakina
            [user_id] => 72
            [date] => 2016-10-08 09:04:10
            [time] => 28:47:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 6
            [personal_best] => 28:47:00
        )

    [82] => stdClass Object
        (
            [rank] => 0
            [ID] => 413
            [run_id] => 29
            [user] => kuzmatrona@gmail.com
            [first_name] => Андрій
            [last_name] => Кузьменко
            [user_id] => 348
            [date] => 2016-09-10 14:00:39
            [time] => 28:49:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 28:49:00
        )

    [83] => stdClass Object
        (
            [rank] => 0
            [ID] => 414
            [run_id] => 29
            [user] => karabashi@gmail.com
            [first_name] => Анастасія
            [last_name] => Безверха
            [user_id] => 347
            [date] => 2016-09-10 14:00:39
            [time] => 29:20:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 29:20:00
        )

    [84] => stdClass Object
        (
            [rank] => 0
            [ID] => 613
            [run_id] => 36
            [user] => p.tetyana.ua@gmail.com
            [first_name] => Тетяна
            [last_name] => Приліпко
            [user_id] => 368
            [date] => 2016-09-24 09:21:50
            [time] => 29:26:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 29:26:00
        )

    [85] => stdClass Object
        (
            [rank] => 0
            [ID] => 2806
            [run_id] => 142
            [user] => GABRIELUDINS@GMAIL.COM
            [first_name] => GABRIEL
            [last_name] => UDIN
            [user_id] => 693
            [date] => 2017-04-01 11:57:35
            [time] => 29:41:00
            [location_title] => Одеса: Парк Шевченка
            [location_link] => https://runday.org/?post_type=runday_location&p=25771
            [location_id] => 25771
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 29:41:00
        )

    [86] => stdClass Object
        (
            [rank] => 0
            [ID] => 509
            [run_id] => 31
            [user] => vuharpro@gmail.com
            [first_name] => Vuhar
            [last_name] => Mamedov
            [user_id] => 378
            [date] => 2016-09-17 13:15:48
            [time] => 30:32:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 30:32:00
        )

    [87] => stdClass Object
        (
            [rank] => 0
            [ID] => 1463
            [run_id] => 74
            [user] => nkarapinka83@gmail.com
            [first_name] => Наталія
            [last_name] => Карапінка
            [user_id] => 656
            [date] => 2016-11-26 13:55:23
            [time] => 31:01:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 31:01:00
        )

    [88] => stdClass Object
        (
            [rank] => 0
            [ID] => 1522
            [run_id] => 78
            [user] => a.usenko@gmail.com
            [first_name] => Andrei
            [last_name] => Usenko
            [user_id] => 61
            [date] => 2016-12-03 09:08:29
            [time] => 31:24:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 31:24:00
        )

    [89] => stdClass Object
        (
            [rank] => 8
            [ID] => 55
            [run_id] => 8
            [user] => conalcampbell@gmail.com
            [first_name] => Conal
            [last_name] => Campbell
            [user_id] => 50
            [date] => 2016-07-30 07:58:33
            [time] => 31:26:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 31:26:00
        )

    [90] => stdClass Object
        (
            [rank] => 0
            [ID] => 1523
            [run_id] => 78
            [user] => natasha.usenko@gmail.com
            [first_name] => Наталия
            [last_name] => Усенко
            [user_id] => 667
            [date] => 2016-12-03 09:08:29
            [time] => 31:43:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 31:43:00
        )

    [91] => stdClass Object
        (
            [rank] => 0
            [ID] => 1724
            [run_id] => 89
            [user] => yurlovsky@i.ua
            [first_name] => Олексій
            [last_name] => Юрловський
            [user_id] => 715
            [date] => 2016-12-31 11:47:21
            [time] => 31:52:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 31:52:00
        )

    [92] => stdClass Object
        (
            [rank] => 0
            [ID] => 799
            [run_id] => 43
            [user] => mdi3101@gmail.com
            [first_name] => Денис
            [last_name] => Майстренко
            [user_id] => 449
            [date] => 2016-10-01 12:24:56
            [time] => 32:06:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 32:06:00
        )

    [93] => stdClass Object
        (
            [rank] => 0
            [ID] => 800
            [run_id] => 43
            [user] => zenichk@gmail.com
            [first_name] => Zee
            [last_name] => Gimon
            [user_id] => 332
            [date] => 2016-10-01 12:24:56
            [time] => 32:37:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 32:37:00
        )

    [94] => stdClass Object
        (
            [rank] => 0
            [ID] => 1726
            [run_id] => 89
            [user] => taissia84@gmail.com
            [first_name] => Таїсія
            [last_name] => Самойлова
            [user_id] => 706
            [date] => 2016-12-31 11:47:21
            [time] => 32:38:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 32:38:00
        )

    [95] => stdClass Object
        (
            [rank] => 0
            [ID] => 801
            [run_id] => 43
            [user] => nataliia.striekha@gmail.com
            [first_name] => Наталія
            [last_name] => Стрєха
            [user_id] => 428
            [date] => 2016-10-01 12:24:56
            [time] => 32:47:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 32:47:00
        )

    [96] => stdClass Object
        (
            [rank] => 0
            [ID] => 205
            [run_id] => 15
            [user] => yanavredina@gmail.com
            [first_name] => Yana
            [last_name] => Kayama
            [user_id] => 177
            [date] => 2016-08-13 09:16:59
            [time] => 32:51:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 32:51:00
        )

    [97] => stdClass Object
        (
            [rank] => 0
            [ID] => 930
            [run_id] => 47
            [user] => ivanytskayu@yahoo.com
            [first_name] => Юля
            [last_name] => Іваницька
            [user_id] => 536
            [date] => 2016-10-15 08:02:51
            [time] => 33:05:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 33:05:00
        )

    [98] => stdClass Object
        (
            [rank] => 0
            [ID] => 2044
            [run_id] => 106
            [user] => olena.tverda@ucu.edu.ua
            [first_name] => Олена
            [last_name] => Тверда
            [user_id] => 846
            [date] => 2017-02-04 15:23:35
            [time] => 34:57:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 34:57:00
        )

    [99] => stdClass Object
        (
            [rank] => 0
            [ID] => 805
            [run_id] => 43
            [user] => ulik@pcholkin.com
            [first_name] => Уляна
            [last_name] => Пчолкіна
            [user_id] => 419
            [date] => 2016-10-01 12:24:56
            [time] => 36:13:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 36:13:00
        )

    [100] => stdClass Object
        (
            [rank] => 15
            [ID] => 73
            [run_id] => 9
            [user] => nahgwaterry@gmail.com
            [first_name] => Terry
            [last_name] => Sama
            [user_id] => 145
            [date] => 2016-08-06 08:45:46
            [time] => 39:49:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 39:49:00
        )

    [101] => stdClass Object
        (
            [rank] => 0
            [ID] => 2302
            [run_id] => 151
            [user] => vm@krasche.com.ua
            [first_name] => Валерія
            [last_name] => Мезенцева
            [user_id] => 896
            [date] => 2017-04-15 20:37:22
            [time] => 59:59:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 2
            [is_only_volunteered] => 1
            [is_volunteered] => 1
            [volunteer_position] => Photographer
            [runs] => 
            [personal_best] => 59:59:00
        )

    [102] => stdClass Object
        (
            [rank] => 0
            [ID] => 426
            [run_id] => 8
            [user] => vero4pr@gmail.com
            [first_name] => Vira
            [last_name] => Prokhyra
            [user_id] => 96
            [date] => 2016-07-30 07:58:33
            [time] => 59:59:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 1
            [is_volunteered] => 1
            [volunteer_position] => Photographer
            [runs] => 
            [personal_best] => 59:59:00
        )

)
Місце Ім’я Час Локація
1 Володимир Ханас 16:31:00 Стрийський парк
2 Сергій Бабич 16:54:00 Труханів Острів, Київ
3 Роман Довбуш 18:02:00 Стрийський парк
4 Северин Наливайко 18:40:00 Труханів Острів, Київ
5 Ярослав Кондюх 19:12:00 Стрийський парк
6 Yuriy Kochurovskyi 19:16:00 Одеса: Парк Шевченка
7 Андрій Куксовський 19:21:00 Стрийський парк
8 Саша Гром'як 19:21:00 Тернопіль: Набережна ставу
9 Андрій Мойсей 19:30:00 Тернопіль: Набережна ставу
10 Євген Резніченко 19:36:00 Тернопіль: Набережна ставу

Чоловіки

SELECT 
		result.event_place as rank, 
		result.ID, 
		run.ID as run_id, 
		user.display_name as user, 
		first_name.meta_value as first_name, 
		last_name.meta_value as last_name, 
		user.ID as user_id, 
		run.date as date, 
		result.time as time, 
		
		location_post.post_title as location_title, 
		location_post.guid as location_link, 
		location_post.ID as location_id,

		club_post.post_title as club_title,
		club_post.guid as club_link,

		volunteer.volunteered as volunteered,
		is_only_volunteered.value as is_only_volunteered,
		result.volunteered as is_volunteered,
		role.title as volunteer_position,

		runner.runs as runs,

		personal_best.value as personal_best

		FROM (SELECT res1.ID, max(res1.run_id) as run_id, res1.user_id, res1.event_place, res1.time, volunteered, volunteer_position
			FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 30
			            AND datediff(now(), meta_value) / 365.25 < 35
					)
				AND user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_sex'
			            AND meta_value = '1'
					)
				) AS res1
			INNER JOIN (
				SELECT user_id, min(time) as time
	            FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 30
			            AND datediff(now(), meta_value) / 365.25 < 35
					)
				AND user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_sex'
			            AND meta_value = '1'
					)
				) AS res3
	            GROUP BY user_id
				) as res2
			ON (res2.user_id = res1.user_id AND res1.time = res2.time)
			GROUP BY user_id
		) as result
		
		LEFT JOIN wp_runday_run as run
		ON result.run_id = run.ID
		
		LEFT JOIN wp_posts as location_post
		ON run.location_id = location_post.ID
		
		LEFT JOIN wp_users as user
		ON result.user_id = user.ID
		
		LEFT JOIN wp_usermeta as first_name
		ON first_name.user_id = user.ID
	    AND first_name.meta_key = 'first_name'
		
		LEFT JOIN wp_usermeta as last_name
		ON last_name.user_id = user.ID
	    AND last_name.meta_key = 'last_name'
		
		LEFT JOIN wp_usermeta as club
		ON club.user_id = user.ID
	    AND club.meta_key = 'club'
		
		LEFT JOIN wp_posts as club_post
		ON club.meta_value = club_post.post_name
		AND club.meta_value != ''
		AND club_post.post_type = 'runday_club'

		LEFT JOIN (
			SELECT user_id, MIN(volunteered) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as is_only_volunteered
		ON is_only_volunteered.user_id = user.ID

		LEFT JOIN (
			SELECT user_id, MIN(time) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as personal_best
		ON personal_best.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, SUM(volunteered) as volunteered
			FROM (
	            SELECT user_id, MAX(volunteered) AS volunteered
				FROM wp_runday_result
				GROUP BY run_id, user_id) as volunteered_per_run
			GROUP BY user_id
			) as volunteer
		ON volunteer.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, count(*) as runs
			FROM (
	            SELECT user_id
				FROM wp_runday_result
				WHERE volunteered = 0) as only_runs
			GROUP BY user_id
			) as runner
		ON runner.user_id = user.ID

		LEFT JOIN wp_runday_volunteer_positions  as role
		ON result.volunteer_position = role.ID

		WHERE 1 = 1
		 ORDER BY  time ASC, volunteered DESCArray
(
    [0] => stdClass Object
        (
            [rank] => 0
            [ID] => 1102
            [run_id] => 57
            [user] => l106itelsport@mail.ru
            [first_name] => Володимир
            [last_name] => Ханас
            [user_id] => 288
            [date] => 2016-10-29 09:56:09
            [time] => 16:31:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 26
            [personal_best] => 16:31:00
        )

    [1] => stdClass Object
        (
            [rank] => 0
            [ID] => 3920
            [run_id] => 208
            [user] => babychdunkan@gmail.com
            [first_name] => Сергій
            [last_name] => Бабич
            [user_id] => 542
            [date] => 2017-06-10 09:27:12
            [time] => 16:54:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 14
            [personal_best] => 16:54:00
        )

    [2] => stdClass Object
        (
            [rank] => 0
            [ID] => 2389
            [run_id] => 126
            [user] => dovbushro@ukr.net
            [first_name] => Роман
            [last_name] => Довбуш
            [user_id] => 321
            [date] => 2017-03-11 21:34:33
            [time] => 18:02:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 9
            [personal_best] => 18:02:00
        )

    [3] => stdClass Object
        (
            [rank] => 0
            [ID] => 4345
            [run_id] => 241
            [user] => 2133390@gmail.com
            [first_name] => Северин
            [last_name] => Наливайко
            [user_id] => 897
            [date] => 2017-07-08 20:02:59
            [time] => 18:40:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 15
            [personal_best] => 18:40:00
        )

    [4] => stdClass Object
        (
            [rank] => 0
            [ID] => 2472
            [run_id] => 131
            [user] => c_ultra@ukr.net
            [first_name] => Ярослав 
            [last_name] => Кондюх
            [user_id] => 254
            [date] => 2017-03-18 16:25:20
            [time] => 19:12:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 19:12:00
        )

    [5] => stdClass Object
        (
            [rank] => 0
            [ID] => 4453
            [run_id] => 247
            [user] => kochurovskyi.y@gmail.com
            [first_name] => Yuriy
            [last_name] => Kochurovskyi
            [user_id] => 1324
            [date] => 2017-07-15 08:02:11
            [time] => 19:16:00
            [location_title] => Одеса: Парк Шевченка
            [location_link] => https://runday.org/?post_type=runday_location&p=25771
            [location_id] => 25771
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 8
            [personal_best] => 19:16:00
        )

    [6] => stdClass Object
        (
            [rank] => 0
            [ID] => 1266
            [run_id] => 65
            [user] => servisestkontakt@gmail.com
            [first_name] => Андрій
            [last_name] => Куксовський
            [user_id] => 593
            [date] => 2016-11-12 11:09:02
            [time] => 19:21:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 19:21:00
        )

    [7] => stdClass Object
        (
            [rank] => 0
            [ID] => 2954
            [run_id] => 148
            [user] => gromiak1109@gmail.com
            [first_name] => Саша
            [last_name] => Гром'як
            [user_id] => 632
            [date] => 2017-04-08 11:25:39
            [time] => 19:21:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 7
            [personal_best] => 19:21:00
        )

    [8] => stdClass Object
        (
            [rank] => 0
            [ID] => 4418
            [run_id] => 245
            [user] => andriymoysey@gmail.com
            [first_name] => Андрій
            [last_name] => Мойсей
            [user_id] => 875
            [date] => 2017-07-15 15:13:30
            [time] => 19:30:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 11
            [personal_best] => 19:30:00
        )

    [9] => stdClass Object
        (
            [rank] => 0
            [ID] => 2664
            [run_id] => 139
            [user] => cerbuha@ukr.net
            [first_name] => Євген
            [last_name] => Резніченко
            [user_id] => 485
            [date] => 2017-04-01 09:59:57
            [time] => 19:36:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 22
            [personal_best] => 19:36:00
        )

    [10] => stdClass Object
        (
            [rank] => 0
            [ID] => 2391
            [run_id] => 126
            [user] => turenko@me.com
            [first_name] => Yaroslav
            [last_name] => Turenko
            [user_id] => 798
            [date] => 2017-03-11 21:34:33
            [time] => 19:43:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 7
            [personal_best] => 19:43:00
        )

    [11] => stdClass Object
        (
            [rank] => 0
            [ID] => 2925
            [run_id] => 147
            [user] => d.degtiarov@gmail.com
            [first_name] => Дмитро
            [last_name] => Дегтярьов
            [user_id] => 931
            [date] => 2017-04-08 10:45:19
            [time] => 19:55:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 19:55:00
        )

    [12] => stdClass Object
        (
            [rank] => 0
            [ID] => 3660
            [run_id] => 194
            [user] => serg1o@ukr.net
            [first_name] => Сергій
            [last_name] => Іваненко
            [user_id] => 445
            [date] => 2017-05-27 15:09:38
            [time] => 20:07:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 24
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 15
            [personal_best] => 20:07:00
        )

    [13] => stdClass Object
        (
            [rank] => 0
            [ID] => 1692
            [run_id] => 89
            [user] => savrick21@gmail.com
            [first_name] => Роман
            [last_name] => Саворона
            [user_id] => 757
            [date] => 2016-12-31 11:47:21
            [time] => 20:07:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 20:07:00
        )

    [14] => stdClass Object
        (
            [rank] => 0
            [ID] => 1269
            [run_id] => 65
            [user] => Jarema.kit@gmail.com
            [first_name] => Ярема
            [last_name] => Кіт
            [user_id] => 320
            [date] => 2016-11-12 11:09:02
            [time] => 20:08:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 12
            [personal_best] => 20:08:00
        )

    [15] => stdClass Object
        (
            [rank] => 0
            [ID] => 4399
            [run_id] => 244
            [user] => andriiusatenko@gmail.com
            [first_name] => Андрій
            [last_name] => Усатенко
            [user_id] => 179
            [date] => 2017-07-15 15:08:14
            [time] => 20:15:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 6
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 44
            [personal_best] => 20:15:00
        )

    [16] => stdClass Object
        (
            [rank] => 0
            [ID] => 771
            [run_id] => 43
            [user] => Sadavan87@gmail.com
            [first_name] => Ігор
            [last_name] => Пилипівський 
            [user_id] => 440
            [date] => 2016-10-01 12:24:56
            [time] => 20:17:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 20:17:00
        )

    [17] => stdClass Object
        (
            [rank] => 0
            [ID] => 917
            [run_id] => 47
            [user] => peter.martynov@gmail.com
            [first_name] => Петро
            [last_name] => Мартинов
            [user_id] => 160
            [date] => 2016-10-15 08:02:51
            [time] => 20:18:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 26
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 9
            [personal_best] => 20:18:00
        )

    [18] => stdClass Object
        (
            [rank] => 0
            [ID] => 1106
            [run_id] => 57
            [user] => lutsyshyn@ukr.net
            [first_name] => Юрій
            [last_name] => Луцишин
            [user_id] => 296
            [date] => 2016-10-29 09:56:09
            [time] => 20:19:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 20:19:00
        )

    [19] => stdClass Object
        (
            [rank] => 0
            [ID] => 1168
            [run_id] => 59
            [user] => usatenko@gmail.com
            [first_name] => Oleksii
            [last_name] => Usatenko
            [user_id] => 175
            [date] => 2016-11-05 09:30:05
            [time] => 20:32:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 5
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 31
            [personal_best] => 20:32:00
        )

    [20] => stdClass Object
        (
            [rank] => 0
            [ID] => 1108
            [run_id] => 57
            [user] => yiprokopchuk@meta.ua
            [first_name] => Yarema
            [last_name] => Prokopchuk
            [user_id] => 259
            [date] => 2016-10-29 09:56:09
            [time] => 20:33:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 20:33:00
        )

    [21] => stdClass Object
        (
            [rank] => 0
            [ID] => 3831
            [run_id] => 204
            [user] => vasylletsyn@gmail.com
            [first_name] => Vasyl
            [last_name] => Letsyn
            [user_id] => 1328
            [date] => 2017-06-10 08:22:09
            [time] => 20:34:00
            [location_title] => Франківськ: Міське озеро 
            [location_link] => https://runday.org/?post_type=runday_location&p=25930
            [location_id] => 25930
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 20:34:00
        )

    [22] => stdClass Object
        (
            [rank] => 0
            [ID] => 390
            [run_id] => 28
            [user] => znack@mail.ru
            [first_name] => Nazar
            [last_name] => Znak
            [user_id] => 356
            [date] => 2016-09-10 13:55:40
            [time] => 21:08:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 21:08:00
        )

    [23] => stdClass Object
        (
            [rank] => 0
            [ID] => 1141
            [run_id] => 58
            [user] => sergbylaa@gmail.com
            [first_name] => Сергій
            [last_name] => Болюк
            [user_id] => 560
            [date] => 2016-11-05 09:26:08
            [time] => 21:13:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 21:13:00
        )

    [24] => stdClass Object
        (
            [rank] => 0
            [ID] => 3927
            [run_id] => 208
            [user] => g0955259669@gmail.com
            [first_name] => Дмитро
            [last_name] => Загородній
            [user_id] => 880
            [date] => 2017-06-10 09:27:12
            [time] => 21:15:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 7
            [personal_best] => 21:15:00
        )

    [25] => stdClass Object
        (
            [rank] => 0
            [ID] => 3928
            [run_id] => 208
            [user] => ruzhytskyi@gmail.com
            [first_name] => Олександр
            [last_name] => Ружицький
            [user_id] => 8
            [date] => 2017-06-10 09:27:12
            [time] => 21:18:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => Everlegal
            [club_link] => https://runday.org/?post_type=runday_club&p=24717
            [volunteered] => 13
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 34
            [personal_best] => 21:18:00
        )

    [26] => stdClass Object
        (
            [rank] => 0
            [ID] => 1275
            [run_id] => 65
            [user] => nfstage@gmail.com
            [first_name] => Fred 
            [last_name] => Erik
            [user_id] => 611
            [date] => 2016-11-12 11:09:02
            [time] => 21:23:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 21:23:00
        )

    [27] => stdClass Object
        (
            [rank] => 0
            [ID] => 320
            [run_id] => 22
            [user] => 777mykola@gmail.com
            [first_name] => Микола
            [last_name] => Кур'янов
            [user_id] => 91
            [date] => 2016-08-27 11:09:06
            [time] => 21:26:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 5
            [personal_best] => 21:26:00
        )

    [28] => stdClass Object
        (
            [rank] => 0
            [ID] => 606
            [run_id] => 36
            [user] => maxim.onufrienko@gmail.com
            [first_name] => Максим
            [last_name] => Онуфрієнко
            [user_id] => 397
            [date] => 2016-09-24 09:21:50
            [time] => 21:48:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 21:48:00
        )

    [29] => stdClass Object
        (
            [rank] => 0
            [ID] => 4434
            [run_id] => 246
            [user] => ryslik@gmail.com
            [first_name] => Руслан
            [last_name] => Ружицький
            [user_id] => 193
            [date] => 2017-07-15 15:14:58
            [time] => 22:14:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 17
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 16
            [personal_best] => 22:14:00
        )

    [30] => stdClass Object
        (
            [rank] => 0
            [ID] => 3766
            [run_id] => 201
            [user] => tws.zp.ua@gmail.com
            [first_name] => Андрей
            [last_name] => Сидоренко
            [user_id] => 786
            [date] => 2017-06-03 18:58:26
            [time] => 22:19:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 10
            [personal_best] => 22:19:00
        )

    [31] => stdClass Object
        (
            [rank] => 0
            [ID] => 775
            [run_id] => 43
            [user] => o.onyschenko@gmail.com
            [first_name] => Олексій
            [last_name] => Онищенко
            [user_id] => 409
            [date] => 2016-10-01 12:24:56
            [time] => 22:23:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 22:23:00
        )

    [32] => stdClass Object
        (
            [rank] => 0
            [ID] => 655
            [run_id] => 38
            [user] => nazar.stetsyk@gmail.com
            [first_name] => Назарій
            [last_name] => Стецик
            [user_id] => 395
            [date] => 2016-10-01 09:22:43
            [time] => 22:35:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 22:35:00
        )

    [33] => stdClass Object
        (
            [rank] => 0
            [ID] => 291
            [run_id] => 20
            [user] => viktor.zvarych@gmail.com
            [first_name] => Віктор
            [last_name] => Зварич
            [user_id] => 238
            [date] => 2016-08-20 10:00:01
            [time] => 22:49:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 22:49:00
        )

    [34] => stdClass Object
        (
            [rank] => 0
            [ID] => 1790
            [run_id] => 91
            [user] => romko.fm@gmail.com
            [first_name] => Ромко
            [last_name] => Задорожний
            [user_id] => 651
            [date] => 2016-12-31 12:07:43
            [time] => 22:54:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 6
            [personal_best] => 22:54:00
        )

    [35] => stdClass Object
        (
            [rank] => 0
            [ID] => 2405
            [run_id] => 126
            [user] => Greenb@ukr.net
            [first_name] => Роман
            [last_name] => Петренко
            [user_id] => 770
            [date] => 2017-03-11 21:34:33
            [time] => 23:01:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 23:01:00
        )

    [36] => stdClass Object
        (
            [rank] => 0
            [ID] => 1705
            [run_id] => 94
            [user] => post_asu@mail.ru
            [first_name] => Микола
            [last_name] => Жуков 
            [user_id] => 51
            [date] => 2017-01-07 17:54:37
            [time] => 23:05:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 23:05:00
        )

    [37] => stdClass Object
        (
            [rank] => 0
            [ID] => 3562
            [run_id] => 188
            [user] => Shuma_s@bigmir.net
            [first_name] => Сергій
            [last_name] => Шумега
            [user_id] => 1465
            [date] => 2017-05-20 19:52:32
            [time] => 23:06:00
            [location_title] => Франківськ: Міське озеро 
            [location_link] => https://runday.org/?post_type=runday_location&p=25930
            [location_id] => 25930
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 23:06:00
        )

    [38] => stdClass Object
        (
            [rank] => 0
            [ID] => 1706
            [run_id] => 89
            [user] => alexluba22@rambler.ru
            [first_name] => Олександр
            [last_name] => Либа
            [user_id] => 794
            [date] => 2016-12-31 11:47:21
            [time] => 23:09:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 23:09:00
        )

    [39] => stdClass Object
        (
            [rank] => 0
            [ID] => 517
            [run_id] => 32
            [user] => maksym.bil@gmail.com
            [first_name] => Макс
            [last_name] => Біляєвський
            [user_id] => 89
            [date] => 2016-09-18 04:20:29
            [time] => 23:29:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 23:29:00
        )

    [40] => stdClass Object
        (
            [rank] => 0
            [ID] => 924
            [run_id] => 47
            [user] => Yevhen
            [first_name] => Yevhen
            [last_name] => Kuzyk
            [user_id] => 25
            [date] => 2016-10-15 08:02:51
            [time] => 23:40:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 3
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 15
            [personal_best] => 23:40:00
        )

    [41] => stdClass Object
        (
            [rank] => 0
            [ID] => 1708
            [run_id] => 89
            [user] => sergey.spivak@gmail.com
            [first_name] => СЕРГІЙ
            [last_name] => СПІВАК
            [user_id] => 736
            [date] => 2016-12-31 11:47:21
            [time] => 23:47:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 23:47:00
        )

    [42] => stdClass Object
        (
            [rank] => 0
            [ID] => 3866
            [run_id] => 205
            [user] => tararasik@gmail.com
            [first_name] => Тарас
            [last_name] => Войтович
            [user_id] => 220
            [date] => 2017-06-10 09:30:43
            [time] => 23:58:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 23:58:00
        )

    [43] => stdClass Object
        (
            [rank] => 0
            [ID] => 4441
            [run_id] => 246
            [user] => shpakdmitriy@gmail.com
            [first_name] => Дмитро
            [last_name] => Шпак
            [user_id] => 244
            [date] => 2017-07-15 15:14:58
            [time] => 24:05:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 22
            [personal_best] => 24:05:00
        )

    [44] => stdClass Object
        (
            [rank] => 0
            [ID] => 1286
            [run_id] => 65
            [user] => kulchik30@gmail.com
            [first_name] => Юра
            [last_name] => Кульчик
            [user_id] => 614
            [date] => 2016-11-12 11:09:02
            [time] => 24:34:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 24:34:00
        )

    [45] => stdClass Object
        (
            [rank] => 0
            [ID] => 1943
            [run_id] => 101
            [user] => romavrv@gmail.com
            [first_name] => Роман
            [last_name] => Вижиковський
            [user_id] => 652
            [date] => 2017-01-28 14:14:01
            [time] => 24:40:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 6
            [personal_best] => 24:40:00
        )

    [46] => stdClass Object
        (
            [rank] => 0
            [ID] => 1120
            [run_id] => 57
            [user] => vovandos@gmail.com
            [first_name] => Володимир
            [last_name] => Врублевський
            [user_id] => 271
            [date] => 2016-10-29 09:56:09
            [time] => 24:43:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 12
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 24:43:00
        )

    [47] => stdClass Object
        (
            [rank] => 0
            [ID] => 293
            [run_id] => 20
            [user] => az@ruhomi.com
            [first_name] => Андрій
            [last_name] => Звірко
            [user_id] => 242
            [date] => 2016-08-20 10:00:01
            [time] => 24:49:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 24:49:00
        )

    [48] => stdClass Object
        (
            [rank] => 0
            [ID] => 954
            [run_id] => 48
            [user] => vitaxa2007@rambler.ru
            [first_name] => Павло
            [last_name] => Хрущов
            [user_id] => 539
            [date] => 2016-10-15 10:04:16
            [time] => 24:54:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 24:54:00
        )

    [49] => stdClass Object
        (
            [rank] => 0
            [ID] => 3844
            [run_id] => 204
            [user] => andriy1215@mail.ru
            [first_name] => Андрій
            [last_name] => Пришляк
            [user_id] => 1263
            [date] => 2017-06-10 08:22:09
            [time] => 24:59:00
            [location_title] => Франківськ: Міське озеро 
            [location_link] => https://runday.org/?post_type=runday_location&p=25930
            [location_id] => 25930
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 24:59:00
        )

    [50] => stdClass Object
        (
            [rank] => 0
            [ID] => 612
            [run_id] => 36
            [user] => invisible.cd@gmail.com
            [first_name] => Денис
            [last_name] => Черевко
            [user_id] => 346
            [date] => 2016-09-24 09:21:50
            [time] => 25:05:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 6
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 11
            [personal_best] => 25:05:00
        )

    [51] => stdClass Object
        (
            [rank] => 0
            [ID] => 3367
            [run_id] => 177
            [user] => larson05@list.ru
            [first_name] => Алексей
            [last_name] => Парфёнов
            [user_id] => 1370
            [date] => 2017-05-06 08:25:40
            [time] => 25:18:00
            [location_title] => Одеса: Парк Шевченка
            [location_link] => https://runday.org/?post_type=runday_location&p=25771
            [location_id] => 25771
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 25:18:00
        )

    [52] => stdClass Object
        (
            [rank] => 0
            [ID] => 864
            [run_id] => 44
            [user] => ovcharenko_m83@mail.ru
            [first_name] => Ovcharenko
            [last_name] => Mykhailo
            [user_id] => 401
            [date] => 2016-10-08 09:04:10
            [time] => 25:30:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 25:30:00
        )

    [53] => stdClass Object
        (
            [rank] => 0
            [ID] => 1864
            [run_id] => 96
            [user] => dimag999@hotmail.com
            [first_name] => Dmitriy
            [last_name] => Gaistruk
            [user_id] => 820
            [date] => 2017-01-14 18:26:32
            [time] => 26:13:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 26:13:00
        )

    [54] => stdClass Object
        (
            [rank] => 0
            [ID] => 1886
            [run_id] => 97
            [user] => maks@webakcent.pro
            [first_name] => Максим
            [last_name] => Слободянюк
            [user_id] => 808
            [date] => 2017-01-14 18:34:23
            [time] => 26:26:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 26:26:00
        )

    [55] => stdClass Object
        (
            [rank] => 0
            [ID] => 4406
            [run_id] => 244
            [user] => sergeygt@meta.ua
            [first_name] => Сергей
            [last_name] => Евсюков
            [user_id] => 892
            [date] => 2017-07-15 15:08:14
            [time] => 26:30:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 26:30:00
        )

    [56] => stdClass Object
        (
            [rank] => 0
            [ID] => 198
            [run_id] => 15
            [user] => snipps0233@gmail.com
            [first_name] => Samuel
            [last_name] => Adegoke
            [user_id] => 7
            [date] => 2016-08-13 09:16:59
            [time] => 26:35:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => Veedoo
            [club_link] => http://runday.org/?post_type=runday_club&p=24647
            [volunteered] => 2
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 26:35:00
        )

    [57] => stdClass Object
        (
            [rank] => 0
            [ID] => 1867
            [run_id] => 96
            [user] => o.kucheriavyi@gmail.com
            [first_name] => Oleksandr
            [last_name] => Kucheriavyi
            [user_id] => 819
            [date] => 2017-01-14 18:26:32
            [time] => 26:37:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 26:37:00
        )

    [58] => stdClass Object
        (
            [rank] => 0
            [ID] => 1718
            [run_id] => 89
            [user] => guziy.ua@gmail.com
            [first_name] => Vasyl
            [last_name] => Huziy
            [user_id] => 756
            [date] => 2016-12-31 11:47:21
            [time] => 27:11:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 27:11:00
        )

    [59] => stdClass Object
        (
            [rank] => 0
            [ID] => 2219
            [run_id] => 118
            [user] => thanku4love@gmail.com
            [first_name] => Костянтин
            [last_name] => Салов
            [user_id] => 384
            [date] => 2017-02-25 10:06:51
            [time] => 27:19:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 27:19:00
        )

    [60] => stdClass Object
        (
            [rank] => 0
            [ID] => 1125
            [run_id] => 57
            [user] => voznjuk-andriy@ukr.net
            [first_name] => Андрій
            [last_name] => Вознюк
            [user_id] => 578
            [date] => 2016-10-29 09:56:09
            [time] => 28:13:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 4
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 28:13:00
        )

    [61] => stdClass Object
        (
            [rank] => 0
            [ID] => 2501
            [run_id] => 131
            [user] => varshone@gmail.com
            [first_name] => Орест
            [last_name] => Гладун
            [user_id] => 369
            [date] => 2017-03-18 16:25:20
            [time] => 28:17:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 28:17:00
        )

    [62] => stdClass Object
        (
            [rank] => 0
            [ID] => 2100
            [run_id] => 110
            [user] => sviat3@gmail.com
            [first_name] => Святослав 
            [last_name] => Абрам'юк
            [user_id] => 707
            [date] => 2017-02-11 18:10:42
            [time] => 28:34:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 5
            [personal_best] => 28:34:00
        )

    [63] => stdClass Object
        (
            [rank] => 0
            [ID] => 413
            [run_id] => 29
            [user] => kuzmatrona@gmail.com
            [first_name] => Андрій
            [last_name] => Кузьменко
            [user_id] => 348
            [date] => 2016-09-10 14:00:39
            [time] => 28:49:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 28:49:00
        )

    [64] => stdClass Object
        (
            [rank] => 0
            [ID] => 2806
            [run_id] => 142
            [user] => GABRIELUDINS@GMAIL.COM
            [first_name] => GABRIEL
            [last_name] => UDIN
            [user_id] => 693
            [date] => 2017-04-01 11:57:35
            [time] => 29:41:00
            [location_title] => Одеса: Парк Шевченка
            [location_link] => https://runday.org/?post_type=runday_location&p=25771
            [location_id] => 25771
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 29:41:00
        )

    [65] => stdClass Object
        (
            [rank] => 0
            [ID] => 509
            [run_id] => 31
            [user] => vuharpro@gmail.com
            [first_name] => Vuhar
            [last_name] => Mamedov
            [user_id] => 378
            [date] => 2016-09-17 13:15:48
            [time] => 30:32:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 30:32:00
        )

    [66] => stdClass Object
        (
            [rank] => 0
            [ID] => 1522
            [run_id] => 78
            [user] => a.usenko@gmail.com
            [first_name] => Andrei
            [last_name] => Usenko
            [user_id] => 61
            [date] => 2016-12-03 09:08:29
            [time] => 31:24:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 31:24:00
        )

    [67] => stdClass Object
        (
            [rank] => 8
            [ID] => 55
            [run_id] => 8
            [user] => conalcampbell@gmail.com
            [first_name] => Conal
            [last_name] => Campbell
            [user_id] => 50
            [date] => 2016-07-30 07:58:33
            [time] => 31:26:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 31:26:00
        )

    [68] => stdClass Object
        (
            [rank] => 0
            [ID] => 1724
            [run_id] => 89
            [user] => yurlovsky@i.ua
            [first_name] => Олексій
            [last_name] => Юрловський
            [user_id] => 715
            [date] => 2016-12-31 11:47:21
            [time] => 31:52:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 31:52:00
        )

    [69] => stdClass Object
        (
            [rank] => 0
            [ID] => 799
            [run_id] => 43
            [user] => mdi3101@gmail.com
            [first_name] => Денис
            [last_name] => Майстренко
            [user_id] => 449
            [date] => 2016-10-01 12:24:56
            [time] => 32:06:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 32:06:00
        )

)
Місце Ім’я Час Локація
1 Володимир Ханас 16:31:00 Стрийський парк
2 Сергій Бабич 16:54:00 Труханів Острів, Київ
3 Роман Довбуш 18:02:00 Стрийський парк
4 Северин Наливайко 18:40:00 Труханів Острів, Київ
5 Ярослав Кондюх 19:12:00 Стрийський парк
6 Yuriy Kochurovskyi 19:16:00 Одеса: Парк Шевченка
7 Андрій Куксовський 19:21:00 Стрийський парк
8 Саша Гром'як 19:21:00 Тернопіль: Набережна ставу
9 Андрій Мойсей 19:30:00 Тернопіль: Набережна ставу
10 Євген Резніченко 19:36:00 Тернопіль: Набережна ставу

Жінки

SELECT 
		result.event_place as rank, 
		result.ID, 
		run.ID as run_id, 
		user.display_name as user, 
		first_name.meta_value as first_name, 
		last_name.meta_value as last_name, 
		user.ID as user_id, 
		run.date as date, 
		result.time as time, 
		
		location_post.post_title as location_title, 
		location_post.guid as location_link, 
		location_post.ID as location_id,

		club_post.post_title as club_title,
		club_post.guid as club_link,

		volunteer.volunteered as volunteered,
		is_only_volunteered.value as is_only_volunteered,
		result.volunteered as is_volunteered,
		role.title as volunteer_position,

		runner.runs as runs,

		personal_best.value as personal_best

		FROM (SELECT res1.ID, max(res1.run_id) as run_id, res1.user_id, res1.event_place, res1.time, volunteered, volunteer_position
			FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 30
			            AND datediff(now(), meta_value) / 365.25 < 35
					)
				AND user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_sex'
			            AND meta_value = '2'
					)
				) AS res1
			INNER JOIN (
				SELECT user_id, min(time) as time
	            FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 30
			            AND datediff(now(), meta_value) / 365.25 < 35
					)
				AND user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_sex'
			            AND meta_value = '2'
					)
				) AS res3
	            GROUP BY user_id
				) as res2
			ON (res2.user_id = res1.user_id AND res1.time = res2.time)
			GROUP BY user_id
		) as result
		
		LEFT JOIN wp_runday_run as run
		ON result.run_id = run.ID
		
		LEFT JOIN wp_posts as location_post
		ON run.location_id = location_post.ID
		
		LEFT JOIN wp_users as user
		ON result.user_id = user.ID
		
		LEFT JOIN wp_usermeta as first_name
		ON first_name.user_id = user.ID
	    AND first_name.meta_key = 'first_name'
		
		LEFT JOIN wp_usermeta as last_name
		ON last_name.user_id = user.ID
	    AND last_name.meta_key = 'last_name'
		
		LEFT JOIN wp_usermeta as club
		ON club.user_id = user.ID
	    AND club.meta_key = 'club'
		
		LEFT JOIN wp_posts as club_post
		ON club.meta_value = club_post.post_name
		AND club.meta_value != ''
		AND club_post.post_type = 'runday_club'

		LEFT JOIN (
			SELECT user_id, MIN(volunteered) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as is_only_volunteered
		ON is_only_volunteered.user_id = user.ID

		LEFT JOIN (
			SELECT user_id, MIN(time) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as personal_best
		ON personal_best.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, SUM(volunteered) as volunteered
			FROM (
	            SELECT user_id, MAX(volunteered) AS volunteered
				FROM wp_runday_result
				GROUP BY run_id, user_id) as volunteered_per_run
			GROUP BY user_id
			) as volunteer
		ON volunteer.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, count(*) as runs
			FROM (
	            SELECT user_id
				FROM wp_runday_result
				WHERE volunteered = 0) as only_runs
			GROUP BY user_id
			) as runner
		ON runner.user_id = user.ID

		LEFT JOIN wp_runday_volunteer_positions  as role
		ON result.volunteer_position = role.ID

		WHERE 1 = 1
		 ORDER BY  time ASC, volunteered DESCArray
(
    [0] => stdClass Object
        (
            [rank] => 0
            [ID] => 2559
            [run_id] => 135
            [user] => annshevchuk@gmail.com
            [first_name] => Анна
            [last_name] => Шевчук
            [user_id] => 374
            [date] => 2017-03-25 00:04:03
            [time] => 20:31:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 20:31:00
        )

    [1] => stdClass Object
        (
            [rank] => 0
            [ID] => 3860
            [run_id] => 205
            [user] => branovska82@mail.ru
            [first_name] => Галина
            [last_name] => Брановська 
            [user_id] => 341
            [date] => 2017-06-10 09:30:43
            [time] => 22:07:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 17
            [personal_best] => 22:07:00
        )

    [2] => stdClass Object
        (
            [rank] => 0
            [ID] => 940
            [run_id] => 48
            [user] => olhalola@yahoo.com
            [first_name] => Ольга
            [last_name] => Лола
            [user_id] => 490
            [date] => 2016-10-15 10:04:16
            [time] => 22:08:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 3
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 8
            [personal_best] => 22:08:00
        )

    [3] => stdClass Object
        (
            [rank] => 0
            [ID] => 3304
            [run_id] => 173
            [user] => ramina-d@yandex.ru
            [first_name] => Ramina 
            [last_name] => Dadasheva
            [user_id] => 789
            [date] => 2017-05-06 08:30:16
            [time] => 22:24:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 22:24:00
        )

    [4] => stdClass Object
        (
            [rank] => 0
            [ID] => 2780
            [run_id] => 142
            [user] => Goodviniha@gmail.com
            [first_name] => Вікторія
            [last_name] => Бондаренко
            [user_id] => 1074
            [date] => 2017-04-01 11:57:35
            [time] => 23:20:00
            [location_title] => Одеса: Парк Шевченка
            [location_link] => https://runday.org/?post_type=runday_location&p=25771
            [location_id] => 25771
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 23:20:00
        )

    [5] => stdClass Object
        (
            [rank] => 0
            [ID] => 2407
            [run_id] => 126
            [user] => Ramule@i.ua
            [first_name] => Дарія
            [last_name] => Боднар
            [user_id] => 788
            [date] => 2017-03-11 21:34:33
            [time] => 24:05:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 24:05:00
        )

    [6] => stdClass Object
        (
            [rank] => 0
            [ID] => 627
            [run_id] => 37
            [user] => babichnataliia@gmail.com
            [first_name] => Наталия
            [last_name] => Бабич
            [user_id] => 171
            [date] => 2016-09-24 09:22:59
            [time] => 24:36:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 11
            [personal_best] => 24:36:00
        )

    [7] => stdClass Object
        (
            [rank] => 0
            [ID] => 1712
            [run_id] => 89
            [user] => andorra07@i.ua
            [first_name] => Ірина
            [last_name] => Черной
            [user_id] => 742
            [date] => 2016-12-31 11:47:21
            [time] => 25:14:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 25:14:00
        )

    [8] => stdClass Object
        (
            [rank] => 0
            [ID] => 1713
            [run_id] => 89
            [user] => gerda0283@gmail.com
            [first_name] => Даша
            [last_name] => Гермаш
            [user_id] => 787
            [date] => 2016-12-31 11:47:21
            [time] => 25:21:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 25:21:00
        )

    [9] => stdClass Object
        (
            [rank] => 0
            [ID] => 408
            [run_id] => 29
            [user] => kravetsin@gmail.com
            [first_name] => Inna
            [last_name] => Kravets
            [user_id] => 191
            [date] => 2016-09-10 14:00:39
            [time] => 25:50:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 2
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 5
            [personal_best] => 25:50:00
        )

    [10] => stdClass Object
        (
            [rank] => 0
            [ID] => 2112
            [run_id] => 111
            [user] => m.a.osipov@gmail.com
            [first_name] =>  Марія 
            [last_name] => 
            [user_id] => 69
            [date] => 2017-02-11 11:57:34
            [time] => 25:51:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 25:51:00
        )

    [11] => stdClass Object
        (
            [rank] => 0
            [ID] => 409
            [run_id] => 29
            [user] => olena.zatynatska@gmail.com
            [first_name] => Olena
            [last_name] => Zatynatska
            [user_id] => 144
            [date] => 2016-09-10 14:00:39
            [time] => 26:32:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 26:32:00
        )

    [12] => stdClass Object
        (
            [rank] => 0
            [ID] => 3954
            [run_id] => 210
            [user] => bilazoya@gmail.com
            [first_name] => Зоя
            [last_name] => Біла
            [user_id] => 1114
            [date] => 2017-06-17 14:17:43
            [time] => 26:43:00
            [location_title] => Одеса: Парк Шевченка
            [location_link] => https://runday.org/?post_type=runday_location&p=25771
            [location_id] => 25771
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 10
            [personal_best] => 26:43:00
        )

    [13] => stdClass Object
        (
            [rank] => 0
            [ID] => 786
            [run_id] => 43
            [user] => kvitokslava@ukr.net
            [first_name] => Катя
            [last_name] => Луцька
            [user_id] => 328
            [date] => 2016-10-01 12:24:56
            [time] => 26:48:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 26:48:00
        )

    [14] => stdClass Object
        (
            [rank] => 0
            [ID] => 1239
            [run_id] => 63
            [user] => tanyamis-ch@ukr.net
            [first_name] => Тетяна
            [last_name] => Міськевич
            [user_id] => 559
            [date] => 2016-11-12 11:47:42
            [time] => 27:03:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 27:03:00
        )

    [15] => stdClass Object
        (
            [rank] => 0
            [ID] => 1719
            [run_id] => 89
            [user] => tigressap@gmail.com
            [first_name] => Альона
            [last_name] => Печерна
            [user_id] => 781
            [date] => 2016-12-31 11:47:21
            [time] => 27:18:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 27:18:00
        )

    [16] => stdClass Object
        (
            [rank] => 0
            [ID] => 3879
            [run_id] => 205
            [user] => kklymko@vodafone.ua
            [first_name] => Катерина
            [last_name] => Климко
            [user_id] => 1532
            [date] => 2017-06-10 09:30:43
            [time] => 28:01:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 28:01:00
        )

    [17] => stdClass Object
        (
            [rank] => 0
            [ID] => 527
            [run_id] => 32
            [user] => di.kondratyeva@gmail.com
            [first_name] => Diana
            [last_name] => Kondratieva
            [user_id] => 295
            [date] => 2016-09-18 04:20:29
            [time] => 28:05:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 28:05:00
        )

    [18] => stdClass Object
        (
            [rank] => 0
            [ID] => 874
            [run_id] => 44
            [user] => salenka1@yandex.ru
            [first_name] => Olena
            [last_name] => Bakina
            [user_id] => 72
            [date] => 2016-10-08 09:04:10
            [time] => 28:47:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 6
            [personal_best] => 28:47:00
        )

    [19] => stdClass Object
        (
            [rank] => 0
            [ID] => 414
            [run_id] => 29
            [user] => karabashi@gmail.com
            [first_name] => Анастасія
            [last_name] => Безверха
            [user_id] => 347
            [date] => 2016-09-10 14:00:39
            [time] => 29:20:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 29:20:00
        )

    [20] => stdClass Object
        (
            [rank] => 0
            [ID] => 613
            [run_id] => 36
            [user] => p.tetyana.ua@gmail.com
            [first_name] => Тетяна
            [last_name] => Приліпко
            [user_id] => 368
            [date] => 2016-09-24 09:21:50
            [time] => 29:26:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 29:26:00
        )

    [21] => stdClass Object
        (
            [rank] => 0
            [ID] => 1463
            [run_id] => 74
            [user] => nkarapinka83@gmail.com
            [first_name] => Наталія
            [last_name] => Карапінка
            [user_id] => 656
            [date] => 2016-11-26 13:55:23
            [time] => 31:01:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 31:01:00
        )

    [22] => stdClass Object
        (
            [rank] => 0
            [ID] => 1523
            [run_id] => 78
            [user] => natasha.usenko@gmail.com
            [first_name] => Наталия
            [last_name] => Усенко
            [user_id] => 667
            [date] => 2016-12-03 09:08:29
            [time] => 31:43:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 31:43:00
        )

    [23] => stdClass Object
        (
            [rank] => 0
            [ID] => 800
            [run_id] => 43
            [user] => zenichk@gmail.com
            [first_name] => Zee
            [last_name] => Gimon
            [user_id] => 332
            [date] => 2016-10-01 12:24:56
            [time] => 32:37:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 32:37:00
        )

    [24] => stdClass Object
        (
            [rank] => 0
            [ID] => 1726
            [run_id] => 89
            [user] => taissia84@gmail.com
            [first_name] => Таїсія
            [last_name] => Самойлова
            [user_id] => 706
            [date] => 2016-12-31 11:47:21
            [time] => 32:38:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 32:38:00
        )

    [25] => stdClass Object
        (
            [rank] => 0
            [ID] => 801
            [run_id] => 43
            [user] => nataliia.striekha@gmail.com
            [first_name] => Наталія
            [last_name] => Стрєха
            [user_id] => 428
            [date] => 2016-10-01 12:24:56
            [time] => 32:47:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 32:47:00
        )

    [26] => stdClass Object
        (
            [rank] => 0
            [ID] => 205
            [run_id] => 15
            [user] => yanavredina@gmail.com
            [first_name] => Yana
            [last_name] => Kayama
            [user_id] => 177
            [date] => 2016-08-13 09:16:59
            [time] => 32:51:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 32:51:00
        )

    [27] => stdClass Object
        (
            [rank] => 0
            [ID] => 930
            [run_id] => 47
            [user] => ivanytskayu@yahoo.com
            [first_name] => Юля
            [last_name] => Іваницька
            [user_id] => 536
            [date] => 2016-10-15 08:02:51
            [time] => 33:05:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 33:05:00
        )

    [28] => stdClass Object
        (
            [rank] => 0
            [ID] => 2044
            [run_id] => 106
            [user] => olena.tverda@ucu.edu.ua
            [first_name] => Олена
            [last_name] => Тверда
            [user_id] => 846
            [date] => 2017-02-04 15:23:35
            [time] => 34:57:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 34:57:00
        )

    [29] => stdClass Object
        (
            [rank] => 0
            [ID] => 805
            [run_id] => 43
            [user] => ulik@pcholkin.com
            [first_name] => Уляна
            [last_name] => Пчолкіна
            [user_id] => 419
            [date] => 2016-10-01 12:24:56
            [time] => 36:13:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 36:13:00
        )

    [30] => stdClass Object
        (
            [rank] => 15
            [ID] => 73
            [run_id] => 9
            [user] => nahgwaterry@gmail.com
            [first_name] => Terry
            [last_name] => Sama
            [user_id] => 145
            [date] => 2016-08-06 08:45:46
            [time] => 39:49:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 39:49:00
        )

    [31] => stdClass Object
        (
            [rank] => 0
            [ID] => 2302
            [run_id] => 151
            [user] => vm@krasche.com.ua
            [first_name] => Валерія
            [last_name] => Мезенцева
            [user_id] => 896
            [date] => 2017-04-15 20:37:22
            [time] => 59:59:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 2
            [is_only_volunteered] => 1
            [is_volunteered] => 1
            [volunteer_position] => Photographer
            [runs] => 
            [personal_best] => 59:59:00
        )

    [32] => stdClass Object
        (
            [rank] => 0
            [ID] => 426
            [run_id] => 8
            [user] => vero4pr@gmail.com
            [first_name] => Vira
            [last_name] => Prokhyra
            [user_id] => 96
            [date] => 2016-07-30 07:58:33
            [time] => 59:59:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 1
            [is_volunteered] => 1
            [volunteer_position] => Photographer
            [runs] => 
            [personal_best] => 59:59:00
        )

)
Місце Ім’я Час Локація
1 Анна Шевчук 20:31:00 Тернопіль: Набережна ставу
2 Галина Брановська 22:07:00 Стрийський парк
3 Ольга Лола 22:08:00 Тернопіль: Набережна ставу
4 Ramina Dadasheva 22:24:00 Труханів Острів, Київ
5 Вікторія Бондаренко 23:20:00 Одеса: Парк Шевченка
6 Дарія Боднар 24:05:00 Стрийський парк
7 Наталия Бабич 24:36:00 Труханів Острів, Київ
8 Ірина Черной 25:14:00 Труханів Острів, Київ
9 Даша Гермаш 25:21:00 Труханів Острів, Київ
10 Inna Kravets 25:50:00 Труханів Острів, Київ

35-39.

Топ – 10

SELECT 
		result.event_place as rank, 
		result.ID, 
		run.ID as run_id, 
		user.display_name as user, 
		first_name.meta_value as first_name, 
		last_name.meta_value as last_name, 
		user.ID as user_id, 
		run.date as date, 
		result.time as time, 
		
		location_post.post_title as location_title, 
		location_post.guid as location_link, 
		location_post.ID as location_id,

		club_post.post_title as club_title,
		club_post.guid as club_link,

		volunteer.volunteered as volunteered,
		is_only_volunteered.value as is_only_volunteered,
		result.volunteered as is_volunteered,
		role.title as volunteer_position,

		runner.runs as runs,

		personal_best.value as personal_best

		FROM (SELECT res1.ID, max(res1.run_id) as run_id, res1.user_id, res1.event_place, res1.time, volunteered, volunteer_position
			FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 35
			            AND datediff(now(), meta_value) / 365.25 < 40
					)
				
				) AS res1
			INNER JOIN (
				SELECT user_id, min(time) as time
	            FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 35
			            AND datediff(now(), meta_value) / 365.25 < 40
					)
				
				) AS res3
	            GROUP BY user_id
				) as res2
			ON (res2.user_id = res1.user_id AND res1.time = res2.time)
			GROUP BY user_id
		) as result
		
		LEFT JOIN wp_runday_run as run
		ON result.run_id = run.ID
		
		LEFT JOIN wp_posts as location_post
		ON run.location_id = location_post.ID
		
		LEFT JOIN wp_users as user
		ON result.user_id = user.ID
		
		LEFT JOIN wp_usermeta as first_name
		ON first_name.user_id = user.ID
	    AND first_name.meta_key = 'first_name'
		
		LEFT JOIN wp_usermeta as last_name
		ON last_name.user_id = user.ID
	    AND last_name.meta_key = 'last_name'
		
		LEFT JOIN wp_usermeta as club
		ON club.user_id = user.ID
	    AND club.meta_key = 'club'
		
		LEFT JOIN wp_posts as club_post
		ON club.meta_value = club_post.post_name
		AND club.meta_value != ''
		AND club_post.post_type = 'runday_club'

		LEFT JOIN (
			SELECT user_id, MIN(volunteered) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as is_only_volunteered
		ON is_only_volunteered.user_id = user.ID

		LEFT JOIN (
			SELECT user_id, MIN(time) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as personal_best
		ON personal_best.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, SUM(volunteered) as volunteered
			FROM (
	            SELECT user_id, MAX(volunteered) AS volunteered
				FROM wp_runday_result
				GROUP BY run_id, user_id) as volunteered_per_run
			GROUP BY user_id
			) as volunteer
		ON volunteer.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, count(*) as runs
			FROM (
	            SELECT user_id
				FROM wp_runday_result
				WHERE volunteered = 0) as only_runs
			GROUP BY user_id
			) as runner
		ON runner.user_id = user.ID

		LEFT JOIN wp_runday_volunteer_positions  as role
		ON result.volunteer_position = role.ID

		WHERE 1 = 1
		 ORDER BY  time ASC, volunteered DESCArray
(
    [0] => stdClass Object
        (
            [rank] => 0
            [ID] => 305
            [run_id] => 21
            [user] => oleh.sannikov@gmail.com
            [first_name] => Олег
            [last_name] => Санніков
            [user_id] => 235
            [date] => 2016-08-27 11:00:48
            [time] => 18:13:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 18:13:00
        )

    [1] => stdClass Object
        (
            [rank] => 0
            [ID] => 4333
            [run_id] => 240
            [user] => bluesky-ff@ukr.net
            [first_name] => Віталій
            [last_name] => Бучок
            [user_id] => 767
            [date] => 2017-07-08 08:26:33
            [time] => 19:28:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 5
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 9
            [personal_best] => 19:28:00
        )

    [2] => stdClass Object
        (
            [rank] => 0
            [ID] => 3281
            [run_id] => 172
            [user] => Lulovi@ukr.net
            [first_name] => Олександр
            [last_name] => Улан
            [user_id] => 826
            [date] => 2017-05-06 08:24:06
            [time] => 19:34:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 8
            [personal_best] => 19:34:00
        )

    [3] => stdClass Object
        (
            [rank] => 0
            [ID] => 882
            [run_id] => 45
            [user] => galazuka@gmail.com
            [first_name] => Андрій
            [last_name] => Галазика
            [user_id] => 431
            [date] => 2016-10-08 09:13:00
            [time] => 19:38:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 6
            [personal_best] => 19:38:00
        )

    [4] => stdClass Object
        (
            [rank] => 0
            [ID] => 2842
            [run_id] => 143
            [user] => sokol_jack@mail.ru
            [first_name] => Євген
            [last_name] => Соколовський
            [user_id] => 354
            [date] => 2017-04-01 12:02:35
            [time] => 19:46:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 19:46:00
        )

    [5] => stdClass Object
        (
            [rank] => 0
            [ID] => 2476
            [run_id] => 131
            [user] => igor.fedyna@gmail.com
            [first_name] => Ігор
            [last_name] => Федина
            [user_id] => 873
            [date] => 2017-03-18 16:25:20
            [time] => 20:42:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 6
            [personal_best] => 20:42:00
        )

    [6] => stdClass Object
        (
            [rank] => 0
            [ID] => 3832
            [run_id] => 204
            [user] => yura.goshiy@gmail.com
            [first_name] => Юра
            [last_name] => Гошій
            [user_id] => 1322
            [date] => 2017-06-10 08:22:09
            [time] => 20:47:00
            [location_title] => Франківськ: Міське озеро 
            [location_link] => https://runday.org/?post_type=runday_location&p=25930
            [location_id] => 25930
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 20:47:00
        )

    [7] => stdClass Object
        (
            [rank] => 0
            [ID] => 1695
            [run_id] => 89
            [user] => kislui1982@gmail.com
            [first_name] => Андрей
            [last_name] => Кисленко
            [user_id] => 685
            [date] => 2016-12-31 11:47:21
            [time] => 20:52:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 20:52:00
        )

    [8] => stdClass Object
        (
            [rank] => 0
            [ID] => 3020
            [run_id] => 153
            [user] => tarichok@ukr.net
            [first_name] => Тарас
            [last_name] => Осміловський
            [user_id] => 935
            [date] => 2017-04-15 21:00:46
            [time] => 20:53:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 13
            [personal_best] => 20:53:00
        )

    [9] => stdClass Object
        (
            [rank] => 0
            [ID] => 3925
            [run_id] => 208
            [user] => rudenko.evgenio@gmail.com
            [first_name] => Євген
            [last_name] => Руденко
            [user_id] => 127
            [date] => 2017-06-10 09:27:12
            [time] => 20:55:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 2
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 28
            [personal_best] => 20:55:00
        )

    [10] => stdClass Object
        (
            [rank] => 0
            [ID] => 1749
            [run_id] => 90
            [user] => grown@ua.fm
            [first_name] => Vasil
            [last_name] => Shkoropad
            [user_id] => 740
            [date] => 2016-12-31 11:55:01
            [time] => 20:58:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 20:58:00
        )

    [11] => stdClass Object
        (
            [rank] => 0
            [ID] => 3681
            [run_id] => 196
            [user] => oksaniya36@mail.ru
            [first_name] => Вадим
            [last_name] => Собко
            [user_id] => 804
            [date] => 2017-05-27 19:56:10
            [time] => 20:58:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 12
            [personal_best] => 20:58:00
        )

    [12] => stdClass Object
        (
            [rank] => 0
            [ID] => 1272
            [run_id] => 65
            [user] => lzenyk2012@gmail.com
            [first_name] => Zenoviy
            [last_name] => Lushchyk
            [user_id] => 573
            [date] => 2016-11-12 11:09:02
            [time] => 21:00:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 5
            [personal_best] => 21:00:00
        )

    [13] => stdClass Object
        (
            [rank] => 0
            [ID] => 939
            [run_id] => 48
            [user] => sashanba@gmail.com
            [first_name] => Олександр
            [last_name] => Найда
            [user_id] => 521
            [date] => 2016-10-15 10:04:16
            [time] => 21:09:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 30
            [personal_best] => 21:09:00
        )

    [14] => stdClass Object
        (
            [rank] => 0
            [ID] => 392
            [run_id] => 28
            [user] => eva.nikita@me.com
            [first_name] => Олена
            [last_name] => Нікітась
            [user_id] => 236
            [date] => 2016-09-10 13:55:40
            [time] => 21:38:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 21:38:00
        )

    [15] => stdClass Object
        (
            [rank] => 0
            [ID] => 1750
            [run_id] => 90
            [user] => mypartyzany@gmail.com
            [first_name] => Павло
            [last_name] => Бучко
            [user_id] => 722
            [date] => 2016-12-31 11:55:01
            [time] => 21:43:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 21:43:00
        )

    [16] => stdClass Object
        (
            [rank] => 0
            [ID] => 2202
            [run_id] => 117
            [user] => bodnar.etalon@gmail.com
            [first_name] => Галина
            [last_name] => Боднар
            [user_id] => 673
            [date] => 2017-02-21 22:36:21
            [time] => 21:51:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 12
            [personal_best] => 21:51:00
        )

    [17] => stdClass Object
        (
            [rank] => 0
            [ID] => 3549
            [run_id] => 187
            [user] => vittsymbal@gmail.com
            [first_name] => Віталій
            [last_name] => Цимбал
            [user_id] => 522
            [date] => 2017-05-20 19:27:38
            [time] => 21:52:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 18
            [personal_best] => 21:52:00
        )

    [18] => stdClass Object
        (
            [rank] => 0
            [ID] => 3284
            [run_id] => 172
            [user] => timofey07@ukr.net
            [first_name] => Тимофій
            [last_name] => Широкий
            [user_id] => 567
            [date] => 2017-05-06 08:24:06
            [time] => 21:55:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 23
            [personal_best] => 21:55:00
        )

    [19] => stdClass Object
        (
            [rank] => 0
            [ID] => 1927
            [run_id] => 100
            [user] => spyvovar@ukr.net
            [first_name] => Олександр
            [last_name] => Пивовар
            [user_id] => 737
            [date] => 2017-01-21 07:36:18
            [time] => 22:03:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 22:03:00
        )

    [20] => stdClass Object
        (
            [rank] => 0
            [ID] => 2354
            [run_id] => 125
            [user] => remraru@gmail.com
            [first_name] => Владислав
            [last_name] => Воловик
            [user_id] => 902
            [date] => 2017-03-04 21:55:09
            [time] => 22:13:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 22:13:00
        )

    [21] => stdClass Object
        (
            [rank] => 0
            [ID] => 2400
            [run_id] => 126
            [user] => protsiv.nazar@gmail.com
            [first_name] => Nazar
            [last_name] => Protsiv
            [user_id] => 790
            [date] => 2017-03-11 21:34:33
            [time] => 22:18:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 22:18:00
        )

    [22] => stdClass Object
        (
            [rank] => 0
            [ID] => 1252
            [run_id] => 64
            [user] => rud0007@list.ru
            [first_name] => Алекс
            [last_name] => Руднєв
            [user_id] => 636
            [date] => 2016-11-12 09:31:27
            [time] => 22:34:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 22:34:00
        )

    [23] => stdClass Object
        (
            [rank] => 0
            [ID] => 1113
            [run_id] => 57
            [user] => 1000viza@gmail.com
            [first_name] => Роман
            [last_name] => Возний
            [user_id] => 534
            [date] => 2016-10-29 09:56:09
            [time] => 22:35:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 2
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 22:35:00
        )

    [24] => stdClass Object
        (
            [rank] => 0
            [ID] => 4339
            [run_id] => 240
            [user] => aib1512@ukr.net
            [first_name] => Андрій
            [last_name] => Бородій
            [user_id] => 845
            [date] => 2017-07-08 08:26:33
            [time] => 22:38:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 10
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 15
            [personal_best] => 22:38:00
        )

    [25] => stdClass Object
        (
            [rank] => 0
            [ID] => 885
            [run_id] => 45
            [user] => twister44@mail.ru
            [first_name] => Оксана
            [last_name] => Собко
            [user_id] => 245
            [date] => 2016-10-08 09:13:00
            [time] => 22:48:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 18
            [personal_best] => 22:48:00
        )

    [26] => stdClass Object
        (
            [rank] => 0
            [ID] => 1006
            [run_id] => 52
            [user] => club.milion@gmail.com
            [first_name] => Роман
            [last_name] => Репко
            [user_id] => 548
            [date] => 2016-10-22 09:26:40
            [time] => 22:48:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 22:48:00
        )

    [27] => stdClass Object
        (
            [rank] => 0
            [ID] => 4455
            [run_id] => 247
            [user] => polydreamer@mail.ru
            [first_name] => Rita
            [last_name] => Khomiuk
            [user_id] => 1034
            [date] => 2017-07-15 08:02:11
            [time] => 23:26:00
            [location_title] => Одеса: Парк Шевченка
            [location_link] => https://runday.org/?post_type=runday_location&p=25771
            [location_id] => 25771
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 10
            [personal_best] => 23:26:00
        )

    [28] => stdClass Object
        (
            [rank] => 0
            [ID] => 2363
            [run_id] => 125
            [user] => 2860812456@mail.gov.ua
            [first_name] => Тарас
            [last_name] => Вигнанський
            [user_id] => 872
            [date] => 2017-03-04 21:55:09
            [time] => 23:33:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 23:33:00
        )

    [29] => stdClass Object
        (
            [rank] => 0
            [ID] => 310
            [run_id] => 21
            [user] => nass@senstone.io
            [first_name] => Назар
            [last_name] => Федорчук
            [user_id] => 258
            [date] => 2016-08-27 11:00:48
            [time] => 23:38:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 23:38:00
        )

    [30] => stdClass Object
        (
            [rank] => 0
            [ID] => 520
            [run_id] => 32
            [user] => julik_s@mail.ru
            [first_name] => Юлія
            [last_name] => Соколовська
            [user_id] => 163
            [date] => 2016-09-18 04:20:29
            [time] => 24:08:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 24:08:00
        )

    [31] => stdClass Object
        (
            [rank] => 0
            [ID] => 1449
            [run_id] => 74
            [user] => elit.interio@gmail.com
            [first_name] => Андрій
            [last_name] => Лукашевич
            [user_id] => 644
            [date] => 2016-11-26 13:55:23
            [time] => 24:17:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 8
            [personal_best] => 24:17:00
        )

    [32] => stdClass Object
        (
            [rank] => 0
            [ID] => 314
            [run_id] => 21
            [user] => Bentsakg@gmail.com
            [first_name] => Галина
            [last_name] => Бенцак
            [user_id] => 237
            [date] => 2016-08-27 11:00:48
            [time] => 24:23:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 24:23:00
        )

    [33] => stdClass Object
        (
            [rank] => 0
            [ID] => 4442
            [run_id] => 246
            [user] => novakmac@gmail.com
            [first_name] => Ігор
            [last_name] => Новак
            [user_id] => 645
            [date] => 2017-07-15 15:14:58
            [time] => 24:30:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 23
            [personal_best] => 24:30:00
        )

    [34] => stdClass Object
        (
            [rank] => 0
            [ID] => 1930
            [run_id] => 100
            [user] => aymeric@mail.ru
            [first_name] => Aymeric
            [last_name] => Arzalier
            [user_id] => 285
            [date] => 2017-01-21 07:36:18
            [time] => 24:53:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 24:53:00
        )

    [35] => stdClass Object
        (
            [rank] => 0
            [ID] => 861
            [run_id] => 44
            [user] => anniedesjardins8@hotmail.com
            [first_name] => Annie
            [last_name] => Desjardins
            [user_id] => 365
            [date] => 2016-10-08 09:04:10
            [time] => 24:53:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 24:53:00
        )

    [36] => stdClass Object
        (
            [rank] => 0
            [ID] => 2444
            [run_id] => 128
            [user] => antti.stenhall@iki.fi
            [first_name] => Antti
            [last_name] => Stenhall
            [user_id] => 939
            [date] => 2017-03-11 13:31:20
            [time] => 24:56:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 24:56:00
        )

    [37] => stdClass Object
        (
            [rank] => 0
            [ID] => 1760
            [run_id] => 90
            [user] => tetyana2802@gmail.com
            [first_name] => Tetyana
            [last_name] => Yevstratyeva
            [user_id] => 716
            [date] => 2016-12-31 11:55:01
            [time] => 25:14:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 25:14:00
        )

    [38] => stdClass Object
        (
            [rank] => 0
            [ID] => 2315
            [run_id] => 123
            [user] => pavlo.yurevich@gmail.com
            [first_name] => Павло
            [last_name] => Юревич
            [user_id] => 885
            [date] => 2017-03-04 10:08:45
            [time] => 25:16:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 25:16:00
        )

    [39] => stdClass Object
        (
            [rank] => 0
            [ID] => 1011
            [run_id] => 52
            [user] => djavana@mail.ru
            [first_name] => Люда
            [last_name] => Петраш
            [user_id] => 570
            [date] => 2016-10-22 09:26:40
            [time] => 25:28:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 25:28:00
        )

    [40] => stdClass Object
        (
            [rank] => 0
            [ID] => 263
            [run_id] => 18
            [user] => magas@ukr.net
            [first_name] => Andriy
            [last_name] => Magas
            [user_id] => 233
            [date] => 2016-08-20 07:28:01
            [time] => 25:49:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 25:49:00
        )

    [41] => stdClass Object
        (
            [rank] => 0
            [ID] => 4173
            [run_id] => 227
            [user] => leonilla.guglya@gmail.com
            [first_name] => Леоніла
            [last_name] => Гугля
            [user_id] => 704
            [date] => 2017-07-01 12:06:08
            [time] => 25:56:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 25:56:00
        )

    [42] => stdClass Object
        (
            [rank] => 0
            [ID] => 3291
            [run_id] => 172
            [user] => v.kovalyshyn@gmail.com
            [first_name] => Віталій
            [last_name] => Ковалишин
            [user_id] => 566
            [date] => 2017-05-06 08:24:06
            [time] => 25:59:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 8
            [personal_best] => 25:59:00
        )

    [43] => stdClass Object
        (
            [rank] => 0
            [ID] => 3985
            [run_id] => 213
            [user] => glushenkoviktor@gmail.com
            [first_name] => Viktor
            [last_name] => Glushenko
            [user_id] => 828
            [date] => 2017-06-17 09:54:12
            [time] => 26:01:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 26:01:00
        )

    [44] => stdClass Object
        (
            [rank] => 0
            [ID] => 1944
            [run_id] => 101
            [user] => wirusya290979@gmail.com
            [first_name] => Віра
            [last_name] => Кобзиста
            [user_id] => 793
            [date] => 2017-01-28 14:14:01
            [time] => 26:07:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 5
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 13
            [personal_best] => 26:07:00
        )

    [45] => stdClass Object
        (
            [rank] => 0
            [ID] => 2372
            [run_id] => 125
            [user] => alexyeyev@gmail.com
            [first_name] => Alexander
            [last_name] => Alexyeyev
            [user_id] => 696
            [date] => 2017-03-04 21:55:09
            [time] => 26:19:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 11
            [personal_best] => 26:19:00
        )

    [46] => stdClass Object
        (
            [rank] => 0
            [ID] => 1507
            [run_id] => 77
            [user] => lily_scorpio@mail.ru
            [first_name] => Лілія
            [last_name] => Фальчук 
            [user_id] => 666
            [date] => 2016-12-03 09:05:10
            [time] => 26:34:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 26:34:00
        )

    [47] => stdClass Object
        (
            [rank] => 0
            [ID] => 1160
            [run_id] => 58
            [user] => sm.lviv@gmail.com
            [first_name] => Мар'ян
            [last_name] => Семен
            [user_id] => 610
            [date] => 2016-11-05 09:26:08
            [time] => 27:06:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 27:06:00
        )

    [48] => stdClass Object
        (
            [rank] => 0
            [ID] => 1716
            [run_id] => 89
            [user] => anna-sm@ukr.net
            [first_name] => Анна
            [last_name] => Віницька
            [user_id] => 765
            [date] => 2016-12-31 11:47:21
            [time] => 27:07:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 27:07:00
        )

    [49] => stdClass Object
        (
            [rank] => 0
            [ID] => 788
            [run_id] => 43
            [user] => fantomax88@gmail.com
            [first_name] => Максим
            [last_name] => Усачов
            [user_id] => 387
            [date] => 2016-10-01 12:24:56
            [time] => 27:28:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 27:28:00
        )

    [50] => stdClass Object
        (
            [rank] => 0
            [ID] => 2417
            [run_id] => 126
            [user] => mary.boychuk@gmail.com
            [first_name] => Марія
            [last_name] => Бойчук
            [user_id] => 383
            [date] => 2017-03-11 21:34:33
            [time] => 27:33:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 27:33:00
        )

    [51] => stdClass Object
        (
            [rank] => 0
            [ID] => 412
            [run_id] => 29
            [user] => alisa.wander@gmail.com
            [first_name] => Виктория
            [last_name] => Скляр
            [user_id] => 322
            [date] => 2016-09-10 14:00:39
            [time] => 27:41:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 27:41:00
        )

    [52] => stdClass Object
        (
            [rank] => 0
            [ID] => 2799
            [run_id] => 142
            [user] => nezabydka7@mail.ru
            [first_name] => Оксана
            [last_name] => Малюта
            [user_id] => 1104
            [date] => 2017-04-01 11:57:35
            [time] => 28:17:00
            [location_title] => Одеса: Парк Шевченка
            [location_link] => https://runday.org/?post_type=runday_location&p=25771
            [location_id] => 25771
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 28:17:00
        )

    [53] => stdClass Object
        (
            [rank] => 0
            [ID] => 1975
            [run_id] => 103
            [user] => t.furmanova@gmail.com
            [first_name] => Тетяна
            [last_name] => Фурманова
            [user_id] => 811
            [date] => 2017-01-28 14:50:19
            [time] => 28:57:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 28:57:00
        )

    [54] => stdClass Object
        (
            [rank] => 0
            [ID] => 796
            [run_id] => 43
            [user] => zarichanka@gmail.com
            [first_name] => Natali
            [last_name] => Zarytska
            [user_id] => 447
            [date] => 2016-10-01 12:24:56
            [time] => 30:03:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 30:03:00
        )

    [55] => stdClass Object
        (
            [rank] => 0
            [ID] => 1338
            [run_id] => 67
            [user] => deltorso@tiscali.it
            [first_name] => Stefania
            [last_name] => del Torso
            [user_id] => 617
            [date] => 2016-11-19 11:58:18
            [time] => 30:40:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 30:40:00
        )

    [56] => stdClass Object
        (
            [rank] => 0
            [ID] => 1307
            [run_id] => 66
            [user] => Ian Bearder
            [first_name] => Ian
            [last_name] => Bearder
            [user_id] => 1
            [date] => 2016-11-19 11:51:36
            [time] => 31:03:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => Veedoo
            [club_link] => http://runday.org/?post_type=runday_club&p=24647
            [volunteered] => 26
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 7
            [personal_best] => 31:03:00
        )

    [57] => stdClass Object
        (
            [rank] => 0
            [ID] => 1578
            [run_id] => 83
            [user] => magnit1977@rambler.ru
            [first_name] => Андрій
            [last_name] => Чирка
            [user_id] => 690
            [date] => 2016-12-17 11:04:53
            [time] => 31:07:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 31:07:00
        )

    [58] => stdClass Object
        (
            [rank] => 0
            [ID] => 1725
            [run_id] => 89
            [user] => annavin921@gmail.com
            [first_name] => Сергій
            [last_name] => Віницький
            [user_id] => 766
            [date] => 2016-12-31 11:47:21
            [time] => 32:37:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 32:37:00
        )

    [59] => stdClass Object
        (
            [rank] => 0
            [ID] => 2320
            [run_id] => 123
            [user] => haergue@aol.com
            [first_name] => Eren
            [last_name] => Gumus
            [user_id] => 909
            [date] => 2017-03-04 10:08:45
            [time] => 32:59:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 32:59:00
        )

    [60] => stdClass Object
        (
            [rank] => 0
            [ID] => 803
            [run_id] => 43
            [user] => yuriy.kachkarda@skykillers.com
            [first_name] => Юрий
            [last_name] => Качкарда
            [user_id] => 413
            [date] => 2016-10-01 12:24:56
            [time] => 33:05:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 33:05:00
        )

    [61] => stdClass Object
        (
            [rank] => 0
            [ID] => 1730
            [run_id] => 89
            [user] => grift@list.ru
            [first_name] => Volodymyr
            [last_name] => Morozov
            [user_id] => 784
            [date] => 2016-12-31 11:47:21
            [time] => 35:49:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 35:49:00
        )

    [62] => stdClass Object
        (
            [rank] => 0
            [ID] => 1732
            [run_id] => 89
            [user] => vshihov@gmail.com
            [first_name] => Владислав
            [last_name] => Шихов
            [user_id] => 749
            [date] => 2016-12-31 11:47:21
            [time] => 36:32:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 36:32:00
        )

)
Місце Ім’я Час Локація
1 Олег Санніков 18:13:00 Стрийський парк
2 Віталій Бучок 19:28:00 Тернопіль: Набережна ставу
3 Олександр Улан 19:34:00 Стрийський парк
4 Андрій Галазика 19:38:00 Стрийський парк
5 Євген Соколовський 19:46:00 Труханів Острів, Київ
6 Ігор Федина 20:42:00 Стрийський парк
7 Юра Гошій 20:47:00 Франківськ: Міське озеро
8 Андрей Кисленко 20:52:00 Труханів Острів, Київ
9 Тарас Осміловський 20:53:00 Стрийський парк
10 Євген Руденко 20:55:00 Труханів Острів, Київ

Чоловіки

SELECT 
		result.event_place as rank, 
		result.ID, 
		run.ID as run_id, 
		user.display_name as user, 
		first_name.meta_value as first_name, 
		last_name.meta_value as last_name, 
		user.ID as user_id, 
		run.date as date, 
		result.time as time, 
		
		location_post.post_title as location_title, 
		location_post.guid as location_link, 
		location_post.ID as location_id,

		club_post.post_title as club_title,
		club_post.guid as club_link,

		volunteer.volunteered as volunteered,
		is_only_volunteered.value as is_only_volunteered,
		result.volunteered as is_volunteered,
		role.title as volunteer_position,

		runner.runs as runs,

		personal_best.value as personal_best

		FROM (SELECT res1.ID, max(res1.run_id) as run_id, res1.user_id, res1.event_place, res1.time, volunteered, volunteer_position
			FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 35
			            AND datediff(now(), meta_value) / 365.25 < 40
					)
				AND user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_sex'
			            AND meta_value = '1'
					)
				) AS res1
			INNER JOIN (
				SELECT user_id, min(time) as time
	            FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 35
			            AND datediff(now(), meta_value) / 365.25 < 40
					)
				AND user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_sex'
			            AND meta_value = '1'
					)
				) AS res3
	            GROUP BY user_id
				) as res2
			ON (res2.user_id = res1.user_id AND res1.time = res2.time)
			GROUP BY user_id
		) as result
		
		LEFT JOIN wp_runday_run as run
		ON result.run_id = run.ID
		
		LEFT JOIN wp_posts as location_post
		ON run.location_id = location_post.ID
		
		LEFT JOIN wp_users as user
		ON result.user_id = user.ID
		
		LEFT JOIN wp_usermeta as first_name
		ON first_name.user_id = user.ID
	    AND first_name.meta_key = 'first_name'
		
		LEFT JOIN wp_usermeta as last_name
		ON last_name.user_id = user.ID
	    AND last_name.meta_key = 'last_name'
		
		LEFT JOIN wp_usermeta as club
		ON club.user_id = user.ID
	    AND club.meta_key = 'club'
		
		LEFT JOIN wp_posts as club_post
		ON club.meta_value = club_post.post_name
		AND club.meta_value != ''
		AND club_post.post_type = 'runday_club'

		LEFT JOIN (
			SELECT user_id, MIN(volunteered) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as is_only_volunteered
		ON is_only_volunteered.user_id = user.ID

		LEFT JOIN (
			SELECT user_id, MIN(time) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as personal_best
		ON personal_best.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, SUM(volunteered) as volunteered
			FROM (
	            SELECT user_id, MAX(volunteered) AS volunteered
				FROM wp_runday_result
				GROUP BY run_id, user_id) as volunteered_per_run
			GROUP BY user_id
			) as volunteer
		ON volunteer.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, count(*) as runs
			FROM (
	            SELECT user_id
				FROM wp_runday_result
				WHERE volunteered = 0) as only_runs
			GROUP BY user_id
			) as runner
		ON runner.user_id = user.ID

		LEFT JOIN wp_runday_volunteer_positions  as role
		ON result.volunteer_position = role.ID

		WHERE 1 = 1
		 ORDER BY  time ASC, volunteered DESCArray
(
    [0] => stdClass Object
        (
            [rank] => 0
            [ID] => 305
            [run_id] => 21
            [user] => oleh.sannikov@gmail.com
            [first_name] => Олег
            [last_name] => Санніков
            [user_id] => 235
            [date] => 2016-08-27 11:00:48
            [time] => 18:13:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 18:13:00
        )

    [1] => stdClass Object
        (
            [rank] => 0
            [ID] => 4333
            [run_id] => 240
            [user] => bluesky-ff@ukr.net
            [first_name] => Віталій
            [last_name] => Бучок
            [user_id] => 767
            [date] => 2017-07-08 08:26:33
            [time] => 19:28:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 5
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 9
            [personal_best] => 19:28:00
        )

    [2] => stdClass Object
        (
            [rank] => 0
            [ID] => 3281
            [run_id] => 172
            [user] => Lulovi@ukr.net
            [first_name] => Олександр
            [last_name] => Улан
            [user_id] => 826
            [date] => 2017-05-06 08:24:06
            [time] => 19:34:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 8
            [personal_best] => 19:34:00
        )

    [3] => stdClass Object
        (
            [rank] => 0
            [ID] => 882
            [run_id] => 45
            [user] => galazuka@gmail.com
            [first_name] => Андрій
            [last_name] => Галазика
            [user_id] => 431
            [date] => 2016-10-08 09:13:00
            [time] => 19:38:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 6
            [personal_best] => 19:38:00
        )

    [4] => stdClass Object
        (
            [rank] => 0
            [ID] => 2842
            [run_id] => 143
            [user] => sokol_jack@mail.ru
            [first_name] => Євген
            [last_name] => Соколовський
            [user_id] => 354
            [date] => 2017-04-01 12:02:35
            [time] => 19:46:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 19:46:00
        )

    [5] => stdClass Object
        (
            [rank] => 0
            [ID] => 2476
            [run_id] => 131
            [user] => igor.fedyna@gmail.com
            [first_name] => Ігор
            [last_name] => Федина
            [user_id] => 873
            [date] => 2017-03-18 16:25:20
            [time] => 20:42:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 6
            [personal_best] => 20:42:00
        )

    [6] => stdClass Object
        (
            [rank] => 0
            [ID] => 3832
            [run_id] => 204
            [user] => yura.goshiy@gmail.com
            [first_name] => Юра
            [last_name] => Гошій
            [user_id] => 1322
            [date] => 2017-06-10 08:22:09
            [time] => 20:47:00
            [location_title] => Франківськ: Міське озеро 
            [location_link] => https://runday.org/?post_type=runday_location&p=25930
            [location_id] => 25930
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 20:47:00
        )

    [7] => stdClass Object
        (
            [rank] => 0
            [ID] => 1695
            [run_id] => 89
            [user] => kislui1982@gmail.com
            [first_name] => Андрей
            [last_name] => Кисленко
            [user_id] => 685
            [date] => 2016-12-31 11:47:21
            [time] => 20:52:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 20:52:00
        )

    [8] => stdClass Object
        (
            [rank] => 0
            [ID] => 3020
            [run_id] => 153
            [user] => tarichok@ukr.net
            [first_name] => Тарас
            [last_name] => Осміловський
            [user_id] => 935
            [date] => 2017-04-15 21:00:46
            [time] => 20:53:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 13
            [personal_best] => 20:53:00
        )

    [9] => stdClass Object
        (
            [rank] => 0
            [ID] => 3925
            [run_id] => 208
            [user] => rudenko.evgenio@gmail.com
            [first_name] => Євген
            [last_name] => Руденко
            [user_id] => 127
            [date] => 2017-06-10 09:27:12
            [time] => 20:55:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 2
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 28
            [personal_best] => 20:55:00
        )

    [10] => stdClass Object
        (
            [rank] => 0
            [ID] => 1749
            [run_id] => 90
            [user] => grown@ua.fm
            [first_name] => Vasil
            [last_name] => Shkoropad
            [user_id] => 740
            [date] => 2016-12-31 11:55:01
            [time] => 20:58:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 20:58:00
        )

    [11] => stdClass Object
        (
            [rank] => 0
            [ID] => 3681
            [run_id] => 196
            [user] => oksaniya36@mail.ru
            [first_name] => Вадим
            [last_name] => Собко
            [user_id] => 804
            [date] => 2017-05-27 19:56:10
            [time] => 20:58:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 12
            [personal_best] => 20:58:00
        )

    [12] => stdClass Object
        (
            [rank] => 0
            [ID] => 1272
            [run_id] => 65
            [user] => lzenyk2012@gmail.com
            [first_name] => Zenoviy
            [last_name] => Lushchyk
            [user_id] => 573
            [date] => 2016-11-12 11:09:02
            [time] => 21:00:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 5
            [personal_best] => 21:00:00
        )

    [13] => stdClass Object
        (
            [rank] => 0
            [ID] => 939
            [run_id] => 48
            [user] => sashanba@gmail.com
            [first_name] => Олександр
            [last_name] => Найда
            [user_id] => 521
            [date] => 2016-10-15 10:04:16
            [time] => 21:09:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 30
            [personal_best] => 21:09:00
        )

    [14] => stdClass Object
        (
            [rank] => 0
            [ID] => 1750
            [run_id] => 90
            [user] => mypartyzany@gmail.com
            [first_name] => Павло
            [last_name] => Бучко
            [user_id] => 722
            [date] => 2016-12-31 11:55:01
            [time] => 21:43:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 21:43:00
        )

    [15] => stdClass Object
        (
            [rank] => 0
            [ID] => 3549
            [run_id] => 187
            [user] => vittsymbal@gmail.com
            [first_name] => Віталій
            [last_name] => Цимбал
            [user_id] => 522
            [date] => 2017-05-20 19:27:38
            [time] => 21:52:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 18
            [personal_best] => 21:52:00
        )

    [16] => stdClass Object
        (
            [rank] => 0
            [ID] => 3284
            [run_id] => 172
            [user] => timofey07@ukr.net
            [first_name] => Тимофій
            [last_name] => Широкий
            [user_id] => 567
            [date] => 2017-05-06 08:24:06
            [time] => 21:55:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 23
            [personal_best] => 21:55:00
        )

    [17] => stdClass Object
        (
            [rank] => 0
            [ID] => 1927
            [run_id] => 100
            [user] => spyvovar@ukr.net
            [first_name] => Олександр
            [last_name] => Пивовар
            [user_id] => 737
            [date] => 2017-01-21 07:36:18
            [time] => 22:03:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 22:03:00
        )

    [18] => stdClass Object
        (
            [rank] => 0
            [ID] => 2354
            [run_id] => 125
            [user] => remraru@gmail.com
            [first_name] => Владислав
            [last_name] => Воловик
            [user_id] => 902
            [date] => 2017-03-04 21:55:09
            [time] => 22:13:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 22:13:00
        )

    [19] => stdClass Object
        (
            [rank] => 0
            [ID] => 2400
            [run_id] => 126
            [user] => protsiv.nazar@gmail.com
            [first_name] => Nazar
            [last_name] => Protsiv
            [user_id] => 790
            [date] => 2017-03-11 21:34:33
            [time] => 22:18:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 22:18:00
        )

    [20] => stdClass Object
        (
            [rank] => 0
            [ID] => 1252
            [run_id] => 64
            [user] => rud0007@list.ru
            [first_name] => Алекс
            [last_name] => Руднєв
            [user_id] => 636
            [date] => 2016-11-12 09:31:27
            [time] => 22:34:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 22:34:00
        )

    [21] => stdClass Object
        (
            [rank] => 0
            [ID] => 1113
            [run_id] => 57
            [user] => 1000viza@gmail.com
            [first_name] => Роман
            [last_name] => Возний
            [user_id] => 534
            [date] => 2016-10-29 09:56:09
            [time] => 22:35:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 2
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 22:35:00
        )

    [22] => stdClass Object
        (
            [rank] => 0
            [ID] => 4339
            [run_id] => 240
            [user] => aib1512@ukr.net
            [first_name] => Андрій
            [last_name] => Бородій
            [user_id] => 845
            [date] => 2017-07-08 08:26:33
            [time] => 22:38:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 10
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 15
            [personal_best] => 22:38:00
        )

    [23] => stdClass Object
        (
            [rank] => 0
            [ID] => 1006
            [run_id] => 52
            [user] => club.milion@gmail.com
            [first_name] => Роман
            [last_name] => Репко
            [user_id] => 548
            [date] => 2016-10-22 09:26:40
            [time] => 22:48:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 22:48:00
        )

    [24] => stdClass Object
        (
            [rank] => 0
            [ID] => 2363
            [run_id] => 125
            [user] => 2860812456@mail.gov.ua
            [first_name] => Тарас
            [last_name] => Вигнанський
            [user_id] => 872
            [date] => 2017-03-04 21:55:09
            [time] => 23:33:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 23:33:00
        )

    [25] => stdClass Object
        (
            [rank] => 0
            [ID] => 310
            [run_id] => 21
            [user] => nass@senstone.io
            [first_name] => Назар
            [last_name] => Федорчук
            [user_id] => 258
            [date] => 2016-08-27 11:00:48
            [time] => 23:38:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 23:38:00
        )

    [26] => stdClass Object
        (
            [rank] => 0
            [ID] => 1449
            [run_id] => 74
            [user] => elit.interio@gmail.com
            [first_name] => Андрій
            [last_name] => Лукашевич
            [user_id] => 644
            [date] => 2016-11-26 13:55:23
            [time] => 24:17:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 8
            [personal_best] => 24:17:00
        )

    [27] => stdClass Object
        (
            [rank] => 0
            [ID] => 4442
            [run_id] => 246
            [user] => novakmac@gmail.com
            [first_name] => Ігор
            [last_name] => Новак
            [user_id] => 645
            [date] => 2017-07-15 15:14:58
            [time] => 24:30:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 23
            [personal_best] => 24:30:00
        )

    [28] => stdClass Object
        (
            [rank] => 0
            [ID] => 1930
            [run_id] => 100
            [user] => aymeric@mail.ru
            [first_name] => Aymeric
            [last_name] => Arzalier
            [user_id] => 285
            [date] => 2017-01-21 07:36:18
            [time] => 24:53:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 24:53:00
        )

    [29] => stdClass Object
        (
            [rank] => 0
            [ID] => 2444
            [run_id] => 128
            [user] => antti.stenhall@iki.fi
            [first_name] => Antti
            [last_name] => Stenhall
            [user_id] => 939
            [date] => 2017-03-11 13:31:20
            [time] => 24:56:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 24:56:00
        )

    [30] => stdClass Object
        (
            [rank] => 0
            [ID] => 2315
            [run_id] => 123
            [user] => pavlo.yurevich@gmail.com
            [first_name] => Павло
            [last_name] => Юревич
            [user_id] => 885
            [date] => 2017-03-04 10:08:45
            [time] => 25:16:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 25:16:00
        )

    [31] => stdClass Object
        (
            [rank] => 0
            [ID] => 263
            [run_id] => 18
            [user] => magas@ukr.net
            [first_name] => Andriy
            [last_name] => Magas
            [user_id] => 233
            [date] => 2016-08-20 07:28:01
            [time] => 25:49:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 25:49:00
        )

    [32] => stdClass Object
        (
            [rank] => 0
            [ID] => 3291
            [run_id] => 172
            [user] => v.kovalyshyn@gmail.com
            [first_name] => Віталій
            [last_name] => Ковалишин
            [user_id] => 566
            [date] => 2017-05-06 08:24:06
            [time] => 25:59:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 8
            [personal_best] => 25:59:00
        )

    [33] => stdClass Object
        (
            [rank] => 0
            [ID] => 3985
            [run_id] => 213
            [user] => glushenkoviktor@gmail.com
            [first_name] => Viktor
            [last_name] => Glushenko
            [user_id] => 828
            [date] => 2017-06-17 09:54:12
            [time] => 26:01:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 26:01:00
        )

    [34] => stdClass Object
        (
            [rank] => 0
            [ID] => 2372
            [run_id] => 125
            [user] => alexyeyev@gmail.com
            [first_name] => Alexander
            [last_name] => Alexyeyev
            [user_id] => 696
            [date] => 2017-03-04 21:55:09
            [time] => 26:19:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 11
            [personal_best] => 26:19:00
        )

    [35] => stdClass Object
        (
            [rank] => 0
            [ID] => 1160
            [run_id] => 58
            [user] => sm.lviv@gmail.com
            [first_name] => Мар'ян
            [last_name] => Семен
            [user_id] => 610
            [date] => 2016-11-05 09:26:08
            [time] => 27:06:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 27:06:00
        )

    [36] => stdClass Object
        (
            [rank] => 0
            [ID] => 788
            [run_id] => 43
            [user] => fantomax88@gmail.com
            [first_name] => Максим
            [last_name] => Усачов
            [user_id] => 387
            [date] => 2016-10-01 12:24:56
            [time] => 27:28:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 27:28:00
        )

    [37] => stdClass Object
        (
            [rank] => 0
            [ID] => 1307
            [run_id] => 66
            [user] => Ian Bearder
            [first_name] => Ian
            [last_name] => Bearder
            [user_id] => 1
            [date] => 2016-11-19 11:51:36
            [time] => 31:03:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => Veedoo
            [club_link] => http://runday.org/?post_type=runday_club&p=24647
            [volunteered] => 26
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 7
            [personal_best] => 31:03:00
        )

    [38] => stdClass Object
        (
            [rank] => 0
            [ID] => 1578
            [run_id] => 83
            [user] => magnit1977@rambler.ru
            [first_name] => Андрій
            [last_name] => Чирка
            [user_id] => 690
            [date] => 2016-12-17 11:04:53
            [time] => 31:07:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 31:07:00
        )

    [39] => stdClass Object
        (
            [rank] => 0
            [ID] => 1725
            [run_id] => 89
            [user] => annavin921@gmail.com
            [first_name] => Сергій
            [last_name] => Віницький
            [user_id] => 766
            [date] => 2016-12-31 11:47:21
            [time] => 32:37:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 32:37:00
        )

    [40] => stdClass Object
        (
            [rank] => 0
            [ID] => 2320
            [run_id] => 123
            [user] => haergue@aol.com
            [first_name] => Eren
            [last_name] => Gumus
            [user_id] => 909
            [date] => 2017-03-04 10:08:45
            [time] => 32:59:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 32:59:00
        )

    [41] => stdClass Object
        (
            [rank] => 0
            [ID] => 803
            [run_id] => 43
            [user] => yuriy.kachkarda@skykillers.com
            [first_name] => Юрий
            [last_name] => Качкарда
            [user_id] => 413
            [date] => 2016-10-01 12:24:56
            [time] => 33:05:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 33:05:00
        )

    [42] => stdClass Object
        (
            [rank] => 0
            [ID] => 1730
            [run_id] => 89
            [user] => grift@list.ru
            [first_name] => Volodymyr
            [last_name] => Morozov
            [user_id] => 784
            [date] => 2016-12-31 11:47:21
            [time] => 35:49:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 35:49:00
        )

    [43] => stdClass Object
        (
            [rank] => 0
            [ID] => 1732
            [run_id] => 89
            [user] => vshihov@gmail.com
            [first_name] => Владислав
            [last_name] => Шихов
            [user_id] => 749
            [date] => 2016-12-31 11:47:21
            [time] => 36:32:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 36:32:00
        )

)
Місце Ім’я Час Локація
1 Олег Санніков 18:13:00 Стрийський парк
2 Віталій Бучок 19:28:00 Тернопіль: Набережна ставу
3 Олександр Улан 19:34:00 Стрийський парк
4 Андрій Галазика 19:38:00 Стрийський парк
5 Євген Соколовський 19:46:00 Труханів Острів, Київ
6 Ігор Федина 20:42:00 Стрийський парк
7 Юра Гошій 20:47:00 Франківськ: Міське озеро
8 Андрей Кисленко 20:52:00 Труханів Острів, Київ
9 Тарас Осміловський 20:53:00 Стрийський парк
10 Євген Руденко 20:55:00 Труханів Острів, Київ

Жінки

SELECT 
		result.event_place as rank, 
		result.ID, 
		run.ID as run_id, 
		user.display_name as user, 
		first_name.meta_value as first_name, 
		last_name.meta_value as last_name, 
		user.ID as user_id, 
		run.date as date, 
		result.time as time, 
		
		location_post.post_title as location_title, 
		location_post.guid as location_link, 
		location_post.ID as location_id,

		club_post.post_title as club_title,
		club_post.guid as club_link,

		volunteer.volunteered as volunteered,
		is_only_volunteered.value as is_only_volunteered,
		result.volunteered as is_volunteered,
		role.title as volunteer_position,

		runner.runs as runs,

		personal_best.value as personal_best

		FROM (SELECT res1.ID, max(res1.run_id) as run_id, res1.user_id, res1.event_place, res1.time, volunteered, volunteer_position
			FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 35
			            AND datediff(now(), meta_value) / 365.25 < 40
					)
				AND user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_sex'
			            AND meta_value = '2'
					)
				) AS res1
			INNER JOIN (
				SELECT user_id, min(time) as time
	            FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 35
			            AND datediff(now(), meta_value) / 365.25 < 40
					)
				AND user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_sex'
			            AND meta_value = '2'
					)
				) AS res3
	            GROUP BY user_id
				) as res2
			ON (res2.user_id = res1.user_id AND res1.time = res2.time)
			GROUP BY user_id
		) as result
		
		LEFT JOIN wp_runday_run as run
		ON result.run_id = run.ID
		
		LEFT JOIN wp_posts as location_post
		ON run.location_id = location_post.ID
		
		LEFT JOIN wp_users as user
		ON result.user_id = user.ID
		
		LEFT JOIN wp_usermeta as first_name
		ON first_name.user_id = user.ID
	    AND first_name.meta_key = 'first_name'
		
		LEFT JOIN wp_usermeta as last_name
		ON last_name.user_id = user.ID
	    AND last_name.meta_key = 'last_name'
		
		LEFT JOIN wp_usermeta as club
		ON club.user_id = user.ID
	    AND club.meta_key = 'club'
		
		LEFT JOIN wp_posts as club_post
		ON club.meta_value = club_post.post_name
		AND club.meta_value != ''
		AND club_post.post_type = 'runday_club'

		LEFT JOIN (
			SELECT user_id, MIN(volunteered) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as is_only_volunteered
		ON is_only_volunteered.user_id = user.ID

		LEFT JOIN (
			SELECT user_id, MIN(time) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as personal_best
		ON personal_best.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, SUM(volunteered) as volunteered
			FROM (
	            SELECT user_id, MAX(volunteered) AS volunteered
				FROM wp_runday_result
				GROUP BY run_id, user_id) as volunteered_per_run
			GROUP BY user_id
			) as volunteer
		ON volunteer.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, count(*) as runs
			FROM (
	            SELECT user_id
				FROM wp_runday_result
				WHERE volunteered = 0) as only_runs
			GROUP BY user_id
			) as runner
		ON runner.user_id = user.ID

		LEFT JOIN wp_runday_volunteer_positions  as role
		ON result.volunteer_position = role.ID

		WHERE 1 = 1
		 ORDER BY  time ASC, volunteered DESCArray
(
    [0] => stdClass Object
        (
            [rank] => 0
            [ID] => 392
            [run_id] => 28
            [user] => eva.nikita@me.com
            [first_name] => Олена
            [last_name] => Нікітась
            [user_id] => 236
            [date] => 2016-09-10 13:55:40
            [time] => 21:38:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 21:38:00
        )

    [1] => stdClass Object
        (
            [rank] => 0
            [ID] => 2202
            [run_id] => 117
            [user] => bodnar.etalon@gmail.com
            [first_name] => Галина
            [last_name] => Боднар
            [user_id] => 673
            [date] => 2017-02-21 22:36:21
            [time] => 21:51:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 12
            [personal_best] => 21:51:00
        )

    [2] => stdClass Object
        (
            [rank] => 0
            [ID] => 885
            [run_id] => 45
            [user] => twister44@mail.ru
            [first_name] => Оксана
            [last_name] => Собко
            [user_id] => 245
            [date] => 2016-10-08 09:13:00
            [time] => 22:48:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 18
            [personal_best] => 22:48:00
        )

    [3] => stdClass Object
        (
            [rank] => 0
            [ID] => 4455
            [run_id] => 247
            [user] => polydreamer@mail.ru
            [first_name] => Rita
            [last_name] => Khomiuk
            [user_id] => 1034
            [date] => 2017-07-15 08:02:11
            [time] => 23:26:00
            [location_title] => Одеса: Парк Шевченка
            [location_link] => https://runday.org/?post_type=runday_location&p=25771
            [location_id] => 25771
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 10
            [personal_best] => 23:26:00
        )

    [4] => stdClass Object
        (
            [rank] => 0
            [ID] => 520
            [run_id] => 32
            [user] => julik_s@mail.ru
            [first_name] => Юлія
            [last_name] => Соколовська
            [user_id] => 163
            [date] => 2016-09-18 04:20:29
            [time] => 24:08:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 24:08:00
        )

    [5] => stdClass Object
        (
            [rank] => 0
            [ID] => 314
            [run_id] => 21
            [user] => Bentsakg@gmail.com
            [first_name] => Галина
            [last_name] => Бенцак
            [user_id] => 237
            [date] => 2016-08-27 11:00:48
            [time] => 24:23:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 24:23:00
        )

    [6] => stdClass Object
        (
            [rank] => 0
            [ID] => 861
            [run_id] => 44
            [user] => anniedesjardins8@hotmail.com
            [first_name] => Annie
            [last_name] => Desjardins
            [user_id] => 365
            [date] => 2016-10-08 09:04:10
            [time] => 24:53:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 24:53:00
        )

    [7] => stdClass Object
        (
            [rank] => 0
            [ID] => 1760
            [run_id] => 90
            [user] => tetyana2802@gmail.com
            [first_name] => Tetyana
            [last_name] => Yevstratyeva
            [user_id] => 716
            [date] => 2016-12-31 11:55:01
            [time] => 25:14:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 25:14:00
        )

    [8] => stdClass Object
        (
            [rank] => 0
            [ID] => 1011
            [run_id] => 52
            [user] => djavana@mail.ru
            [first_name] => Люда
            [last_name] => Петраш
            [user_id] => 570
            [date] => 2016-10-22 09:26:40
            [time] => 25:28:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 25:28:00
        )

    [9] => stdClass Object
        (
            [rank] => 0
            [ID] => 4173
            [run_id] => 227
            [user] => leonilla.guglya@gmail.com
            [first_name] => Леоніла
            [last_name] => Гугля
            [user_id] => 704
            [date] => 2017-07-01 12:06:08
            [time] => 25:56:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 25:56:00
        )

    [10] => stdClass Object
        (
            [rank] => 0
            [ID] => 1944
            [run_id] => 101
            [user] => wirusya290979@gmail.com
            [first_name] => Віра
            [last_name] => Кобзиста
            [user_id] => 793
            [date] => 2017-01-28 14:14:01
            [time] => 26:07:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 5
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 13
            [personal_best] => 26:07:00
        )

    [11] => stdClass Object
        (
            [rank] => 0
            [ID] => 1507
            [run_id] => 77
            [user] => lily_scorpio@mail.ru
            [first_name] => Лілія
            [last_name] => Фальчук 
            [user_id] => 666
            [date] => 2016-12-03 09:05:10
            [time] => 26:34:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 26:34:00
        )

    [12] => stdClass Object
        (
            [rank] => 0
            [ID] => 1716
            [run_id] => 89
            [user] => anna-sm@ukr.net
            [first_name] => Анна
            [last_name] => Віницька
            [user_id] => 765
            [date] => 2016-12-31 11:47:21
            [time] => 27:07:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 27:07:00
        )

    [13] => stdClass Object
        (
            [rank] => 0
            [ID] => 2417
            [run_id] => 126
            [user] => mary.boychuk@gmail.com
            [first_name] => Марія
            [last_name] => Бойчук
            [user_id] => 383
            [date] => 2017-03-11 21:34:33
            [time] => 27:33:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 27:33:00
        )

    [14] => stdClass Object
        (
            [rank] => 0
            [ID] => 412
            [run_id] => 29
            [user] => alisa.wander@gmail.com
            [first_name] => Виктория
            [last_name] => Скляр
            [user_id] => 322
            [date] => 2016-09-10 14:00:39
            [time] => 27:41:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 27:41:00
        )

    [15] => stdClass Object
        (
            [rank] => 0
            [ID] => 2799
            [run_id] => 142
            [user] => nezabydka7@mail.ru
            [first_name] => Оксана
            [last_name] => Малюта
            [user_id] => 1104
            [date] => 2017-04-01 11:57:35
            [time] => 28:17:00
            [location_title] => Одеса: Парк Шевченка
            [location_link] => https://runday.org/?post_type=runday_location&p=25771
            [location_id] => 25771
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 28:17:00
        )

    [16] => stdClass Object
        (
            [rank] => 0
            [ID] => 1975
            [run_id] => 103
            [user] => t.furmanova@gmail.com
            [first_name] => Тетяна
            [last_name] => Фурманова
            [user_id] => 811
            [date] => 2017-01-28 14:50:19
            [time] => 28:57:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 28:57:00
        )

    [17] => stdClass Object
        (
            [rank] => 0
            [ID] => 796
            [run_id] => 43
            [user] => zarichanka@gmail.com
            [first_name] => Natali
            [last_name] => Zarytska
            [user_id] => 447
            [date] => 2016-10-01 12:24:56
            [time] => 30:03:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 30:03:00
        )

    [18] => stdClass Object
        (
            [rank] => 0
            [ID] => 1338
            [run_id] => 67
            [user] => deltorso@tiscali.it
            [first_name] => Stefania
            [last_name] => del Torso
            [user_id] => 617
            [date] => 2016-11-19 11:58:18
            [time] => 30:40:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 30:40:00
        )

)
Місце Ім’я Час Локація
1 Олена Нікітась 21:38:00 Стрийський парк
2 Галина Боднар 21:51:00 Тернопіль: Набережна ставу
3 Оксана Собко 22:48:00 Стрийський парк
4 Rita Khomiuk 23:26:00 Одеса: Парк Шевченка
5 Юлія Соколовська 24:08:00 Труханів Острів, Київ
6 Галина Бенцак 24:23:00 Стрийський парк
7 Annie Desjardins 24:53:00 Труханів Острів, Київ
8 Tetyana Yevstratyeva 25:14:00 Стрийський парк
9 Люда Петраш 25:28:00 Тернопіль: Набережна ставу
10 Леоніла Гугля 25:56:00 Труханів Острів, Київ

40-44.

Топ – 10

SELECT 
		result.event_place as rank, 
		result.ID, 
		run.ID as run_id, 
		user.display_name as user, 
		first_name.meta_value as first_name, 
		last_name.meta_value as last_name, 
		user.ID as user_id, 
		run.date as date, 
		result.time as time, 
		
		location_post.post_title as location_title, 
		location_post.guid as location_link, 
		location_post.ID as location_id,

		club_post.post_title as club_title,
		club_post.guid as club_link,

		volunteer.volunteered as volunteered,
		is_only_volunteered.value as is_only_volunteered,
		result.volunteered as is_volunteered,
		role.title as volunteer_position,

		runner.runs as runs,

		personal_best.value as personal_best

		FROM (SELECT res1.ID, max(res1.run_id) as run_id, res1.user_id, res1.event_place, res1.time, volunteered, volunteer_position
			FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 40
			            AND datediff(now(), meta_value) / 365.25 < 45
					)
				
				) AS res1
			INNER JOIN (
				SELECT user_id, min(time) as time
	            FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 40
			            AND datediff(now(), meta_value) / 365.25 < 45
					)
				
				) AS res3
	            GROUP BY user_id
				) as res2
			ON (res2.user_id = res1.user_id AND res1.time = res2.time)
			GROUP BY user_id
		) as result
		
		LEFT JOIN wp_runday_run as run
		ON result.run_id = run.ID
		
		LEFT JOIN wp_posts as location_post
		ON run.location_id = location_post.ID
		
		LEFT JOIN wp_users as user
		ON result.user_id = user.ID
		
		LEFT JOIN wp_usermeta as first_name
		ON first_name.user_id = user.ID
	    AND first_name.meta_key = 'first_name'
		
		LEFT JOIN wp_usermeta as last_name
		ON last_name.user_id = user.ID
	    AND last_name.meta_key = 'last_name'
		
		LEFT JOIN wp_usermeta as club
		ON club.user_id = user.ID
	    AND club.meta_key = 'club'
		
		LEFT JOIN wp_posts as club_post
		ON club.meta_value = club_post.post_name
		AND club.meta_value != ''
		AND club_post.post_type = 'runday_club'

		LEFT JOIN (
			SELECT user_id, MIN(volunteered) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as is_only_volunteered
		ON is_only_volunteered.user_id = user.ID

		LEFT JOIN (
			SELECT user_id, MIN(time) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as personal_best
		ON personal_best.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, SUM(volunteered) as volunteered
			FROM (
	            SELECT user_id, MAX(volunteered) AS volunteered
				FROM wp_runday_result
				GROUP BY run_id, user_id) as volunteered_per_run
			GROUP BY user_id
			) as volunteer
		ON volunteer.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, count(*) as runs
			FROM (
	            SELECT user_id
				FROM wp_runday_result
				WHERE volunteered = 0) as only_runs
			GROUP BY user_id
			) as runner
		ON runner.user_id = user.ID

		LEFT JOIN wp_runday_volunteer_positions  as role
		ON result.volunteer_position = role.ID

		WHERE 1 = 1
		 ORDER BY  time ASC, volunteered DESCArray
(
    [0] => stdClass Object
        (
            [rank] => 0
            [ID] => 1268
            [run_id] => 65
            [user] => eugene67670@gmail.com
            [first_name] => Євген
            [last_name] => Євстратьєв
            [user_id] => 407
            [date] => 2016-11-12 11:09:02
            [time] => 19:59:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 15
            [personal_best] => 19:59:00
        )

    [1] => stdClass Object
        (
            [rank] => 0
            [ID] => 505
            [run_id] => 31
            [user] => nadysukharyna@live.it
            [first_name] => Надія 
            [last_name] => Сухарина
            [user_id] => 264
            [date] => 2016-09-17 13:15:48
            [time] => 20:08:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 20:08:00
        )

    [2] => stdClass Object
        (
            [rank] => 0
            [ID] => 1297
            [run_id] => 66
            [user] => espanol@ukr.net
            [first_name] => Stanislav
            [last_name] => Yerko
            [user_id] => 95
            [date] => 2016-11-19 11:51:36
            [time] => 20:33:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 20:33:00
        )

    [3] => stdClass Object
        (
            [rank] => 0
            [ID] => 182
            [run_id] => 15
            [user] => mackieevans@mac.com
            [first_name] => Патрiк
            [last_name] => Eванс
            [user_id] => 187
            [date] => 2016-08-13 09:16:59
            [time] => 21:09:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 21:09:00
        )

    [4] => stdClass Object
        (
            [rank] => 0
            [ID] => 1925
            [run_id] => 100
            [user] => en.sergei@gmail.com
            [first_name] => Sergiy
            [last_name] => Kutovyy
            [user_id] => 818
            [date] => 2017-01-21 07:36:18
            [time] => 21:18:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 21:18:00
        )

    [5] => stdClass Object
        (
            [rank] => 0
            [ID] => 4337
            [run_id] => 240
            [user] => m.dzisyak2000@gmail.com
            [first_name] => Максим
            [last_name] => Дзісяк
            [user_id] => 541
            [date] => 2017-07-08 08:26:33
            [time] => 21:33:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 18
            [personal_best] => 21:33:00
        )

    [6] => stdClass Object
        (
            [rank] => 0
            [ID] => 2519
            [run_id] => 133
            [user] => aeroklyb76@bigmir.net
            [first_name] => Олександр
            [last_name] => Медведенко
            [user_id] => 300
            [date] => 2017-03-25 11:55:50
            [time] => 21:51:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 6
            [personal_best] => 21:51:00
        )

    [7] => stdClass Object
        (
            [rank] => 0
            [ID] => 3023
            [run_id] => 153
            [user] => advo@ukr.net
            [first_name] => Oleh
            [last_name] => Panko
            [user_id] => 229
            [date] => 2017-04-15 21:00:46
            [time] => 22:20:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 16
            [personal_best] => 22:20:00
        )

    [8] => stdClass Object
        (
            [rank] => 0
            [ID] => 2983
            [run_id] => 151
            [user] => remi@cospot.ge
            [first_name] => Remi
            [last_name] => Boissonnas
            [user_id] => 56
            [date] => 2017-04-15 20:37:22
            [time] => 22:25:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 3
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 11
            [personal_best] => 22:25:00
        )

    [9] => stdClass Object
        (
            [rank] => 0
            [ID] => 2441
            [run_id] => 128
            [user] => delsian@gmail.com
            [first_name] => Alex
            [last_name] => Delsian
            [user_id] => 836
            [date] => 2017-03-11 13:31:20
            [time] => 23:10:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 3
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 13
            [personal_best] => 23:10:00
        )

    [10] => stdClass Object
        (
            [rank] => 0
            [ID] => 1118
            [run_id] => 57
            [user] => lob08@ukr.net
            [first_name] => Ольга 
            [last_name] => Лопушевська
            [user_id] => 253
            [date] => 2016-10-29 09:56:09
            [time] => 23:11:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 2
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 19
            [personal_best] => 23:11:00
        )

    [11] => stdClass Object
        (
            [rank] => 0
            [ID] => 2779
            [run_id] => 142
            [user] => alexey.berchatov@gmail.com
            [first_name] => Alexey
            [last_name] => Berchatov
            [user_id] => 916
            [date] => 2017-04-01 11:57:35
            [time] => 23:20:00
            [location_title] => Одеса: Парк Шевченка
            [location_link] => https://runday.org/?post_type=runday_location&p=25771
            [location_id] => 25771
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 23:20:00
        )

    [12] => stdClass Object
        (
            [rank] => 0
            [ID] => 325
            [run_id] => 22
            [user] => hradavies@hotmail.com
            [first_name] => Huw
            [last_name] => Davies
            [user_id] => 298
            [date] => 2016-08-27 11:09:06
            [time] => 24:15:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 24:15:00
        )

    [13] => stdClass Object
        (
            [rank] => 0
            [ID] => 1931
            [run_id] => 100
            [user] => yura240777@i.ua
            [first_name] => Yurii
            [last_name] => Raksha
            [user_id] => 823
            [date] => 2017-01-21 07:36:18
            [time] => 24:54:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 24:54:00
        )

    [14] => stdClass Object
        (
            [rank] => 0
            [ID] => 901
            [run_id] => 46
            [user] => cmirandal76@gmail.com
            [first_name] => Cristina
            [last_name] => Leicht
            [user_id] => 504
            [date] => 2016-10-15 07:53:58
            [time] => 26:27:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 26:27:00
        )

    [15] => stdClass Object
        (
            [rank] => 0
            [ID] => 902
            [run_id] => 46
            [user] => lanatm1@yandex.ua
            [first_name] => Світлана
            [last_name] => Трофимчук
            [user_id] => 473
            [date] => 2016-10-15 07:53:58
            [time] => 26:45:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 6
            [personal_best] => 26:45:00
        )

    [16] => stdClass Object
        (
            [rank] => 0
            [ID] => 1717
            [run_id] => 89
            [user] => kravatko@gmail.com
            [first_name] => Руслан
            [last_name] => Рубель
            [user_id] => 764
            [date] => 2016-12-31 11:47:21
            [time] => 27:10:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 27:10:00
        )

    [17] => stdClass Object
        (
            [rank] => 0
            [ID] => 526
            [run_id] => 32
            [user] => mister.walker@yahoo.com
            [first_name] => Richard
            [last_name] => Walker
            [user_id] => 358
            [date] => 2016-09-18 04:20:29
            [time] => 27:34:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 27:34:00
        )

    [18] => stdClass Object
        (
            [rank] => 0
            [ID] => 869
            [run_id] => 44
            [user] => 2236103@gmail.com
            [first_name] => Виталий
            [last_name] => Сластенко
            [user_id] => 386
            [date] => 2016-10-08 09:04:10
            [time] => 28:21:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 10
            [personal_best] => 28:21:00
        )

    [19] => stdClass Object
        (
            [rank] => 0
            [ID] => 633
            [run_id] => 37
            [user] => sandra.l.cavallo@gmail.com
            [first_name] => Sandra
            [last_name] => Cavallo
            [user_id] => 280
            [date] => 2016-09-24 09:22:59
            [time] => 28:58:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 28:58:00
        )

    [20] => stdClass Object
        (
            [rank] => 0
            [ID] => 3525
            [run_id] => 185
            [user] => Yanulya_Guapa@ukr.net
            [first_name] => Галина
            [last_name] => Щепанівська
            [user_id] => 584
            [date] => 2017-05-20 12:47:32
            [time] => 29:17:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 29:17:00
        )

    [21] => stdClass Object
        (
            [rank] => 0
            [ID] => 346
            [run_id] => 24
            [user] => evgen.bochko@gmail.com
            [first_name] => Євген
            [last_name] => Бочко
            [user_id] => 325
            [date] => 2016-09-03 08:15:36
            [time] => 30:14:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 30:14:00
        )

    [22] => stdClass Object
        (
            [rank] => 0
            [ID] => 267
            [run_id] => 18
            [user] => dj_amadeus@hotmail.com
            [first_name] => Michael
            [last_name] => O'Connell
            [user_id] => 198
            [date] => 2016-08-20 07:28:01
            [time] => 30:22:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 30:22:00
        )

    [23] => stdClass Object
        (
            [rank] => 0
            [ID] => 1782
            [run_id] => 90
            [user] => yulchik1975@ukr.net
            [first_name] => Юлія
            [last_name] => Сумко
            [user_id] => 741
            [date] => 2016-12-31 11:55:01
            [time] => 31:52:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 31:52:00
        )

    [24] => stdClass Object
        (
            [rank] => 0
            [ID] => 1727
            [run_id] => 89
            [user] => sag@toursdekiev.com.ua
            [first_name] => Андрій
            [last_name] => Самойлов
            [user_id] => 711
            [date] => 2016-12-31 11:47:21
            [time] => 32:52:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 32:52:00
        )

    [25] => stdClass Object
        (
            [rank] => 0
            [ID] => 512
            [run_id] => 31
            [user] => biley@list.ru
            [first_name] => Анна
            [last_name] => Білей
            [user_id] => 188
            [date] => 2016-09-17 13:15:48
            [time] => 37:52:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 7
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 37:52:00
        )

)
Місце Ім’я Час Локація
1 Євген Євстратьєв 19:59:00 Стрийський парк
2 Надія Сухарина 20:08:00 Стрийський парк
3 Stanislav Yerko 20:33:00 Труханів Острів, Київ
4 Патрiк Eванс 21:09:00 Труханів Острів, Київ
5 Sergiy Kutovyy 21:18:00 Труханів Острів, Київ
6 Максим Дзісяк 21:33:00 Тернопіль: Набережна ставу
7 Олександр Медведенко 21:51:00 Труханів Острів, Київ
8 Oleh Panko 22:20:00 Стрийський парк
9 Remi Boissonnas 22:25:00 Труханів Острів, Київ
10 Alex Delsian 23:10:00 Труханів Острів, Київ

Чоловіки

SELECT 
		result.event_place as rank, 
		result.ID, 
		run.ID as run_id, 
		user.display_name as user, 
		first_name.meta_value as first_name, 
		last_name.meta_value as last_name, 
		user.ID as user_id, 
		run.date as date, 
		result.time as time, 
		
		location_post.post_title as location_title, 
		location_post.guid as location_link, 
		location_post.ID as location_id,

		club_post.post_title as club_title,
		club_post.guid as club_link,

		volunteer.volunteered as volunteered,
		is_only_volunteered.value as is_only_volunteered,
		result.volunteered as is_volunteered,
		role.title as volunteer_position,

		runner.runs as runs,

		personal_best.value as personal_best

		FROM (SELECT res1.ID, max(res1.run_id) as run_id, res1.user_id, res1.event_place, res1.time, volunteered, volunteer_position
			FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 40
			            AND datediff(now(), meta_value) / 365.25 < 45
					)
				AND user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_sex'
			            AND meta_value = '1'
					)
				) AS res1
			INNER JOIN (
				SELECT user_id, min(time) as time
	            FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 40
			            AND datediff(now(), meta_value) / 365.25 < 45
					)
				AND user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_sex'
			            AND meta_value = '1'
					)
				) AS res3
	            GROUP BY user_id
				) as res2
			ON (res2.user_id = res1.user_id AND res1.time = res2.time)
			GROUP BY user_id
		) as result
		
		LEFT JOIN wp_runday_run as run
		ON result.run_id = run.ID
		
		LEFT JOIN wp_posts as location_post
		ON run.location_id = location_post.ID
		
		LEFT JOIN wp_users as user
		ON result.user_id = user.ID
		
		LEFT JOIN wp_usermeta as first_name
		ON first_name.user_id = user.ID
	    AND first_name.meta_key = 'first_name'
		
		LEFT JOIN wp_usermeta as last_name
		ON last_name.user_id = user.ID
	    AND last_name.meta_key = 'last_name'
		
		LEFT JOIN wp_usermeta as club
		ON club.user_id = user.ID
	    AND club.meta_key = 'club'
		
		LEFT JOIN wp_posts as club_post
		ON club.meta_value = club_post.post_name
		AND club.meta_value != ''
		AND club_post.post_type = 'runday_club'

		LEFT JOIN (
			SELECT user_id, MIN(volunteered) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as is_only_volunteered
		ON is_only_volunteered.user_id = user.ID

		LEFT JOIN (
			SELECT user_id, MIN(time) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as personal_best
		ON personal_best.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, SUM(volunteered) as volunteered
			FROM (
	            SELECT user_id, MAX(volunteered) AS volunteered
				FROM wp_runday_result
				GROUP BY run_id, user_id) as volunteered_per_run
			GROUP BY user_id
			) as volunteer
		ON volunteer.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, count(*) as runs
			FROM (
	            SELECT user_id
				FROM wp_runday_result
				WHERE volunteered = 0) as only_runs
			GROUP BY user_id
			) as runner
		ON runner.user_id = user.ID

		LEFT JOIN wp_runday_volunteer_positions  as role
		ON result.volunteer_position = role.ID

		WHERE 1 = 1
		 ORDER BY  time ASC, volunteered DESCArray
(
    [0] => stdClass Object
        (
            [rank] => 0
            [ID] => 1268
            [run_id] => 65
            [user] => eugene67670@gmail.com
            [first_name] => Євген
            [last_name] => Євстратьєв
            [user_id] => 407
            [date] => 2016-11-12 11:09:02
            [time] => 19:59:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 15
            [personal_best] => 19:59:00
        )

    [1] => stdClass Object
        (
            [rank] => 0
            [ID] => 1297
            [run_id] => 66
            [user] => espanol@ukr.net
            [first_name] => Stanislav
            [last_name] => Yerko
            [user_id] => 95
            [date] => 2016-11-19 11:51:36
            [time] => 20:33:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 20:33:00
        )

    [2] => stdClass Object
        (
            [rank] => 0
            [ID] => 182
            [run_id] => 15
            [user] => mackieevans@mac.com
            [first_name] => Патрiк
            [last_name] => Eванс
            [user_id] => 187
            [date] => 2016-08-13 09:16:59
            [time] => 21:09:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 21:09:00
        )

    [3] => stdClass Object
        (
            [rank] => 0
            [ID] => 1925
            [run_id] => 100
            [user] => en.sergei@gmail.com
            [first_name] => Sergiy
            [last_name] => Kutovyy
            [user_id] => 818
            [date] => 2017-01-21 07:36:18
            [time] => 21:18:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 21:18:00
        )

    [4] => stdClass Object
        (
            [rank] => 0
            [ID] => 4337
            [run_id] => 240
            [user] => m.dzisyak2000@gmail.com
            [first_name] => Максим
            [last_name] => Дзісяк
            [user_id] => 541
            [date] => 2017-07-08 08:26:33
            [time] => 21:33:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 18
            [personal_best] => 21:33:00
        )

    [5] => stdClass Object
        (
            [rank] => 0
            [ID] => 2519
            [run_id] => 133
            [user] => aeroklyb76@bigmir.net
            [first_name] => Олександр
            [last_name] => Медведенко
            [user_id] => 300
            [date] => 2017-03-25 11:55:50
            [time] => 21:51:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 6
            [personal_best] => 21:51:00
        )

    [6] => stdClass Object
        (
            [rank] => 0
            [ID] => 3023
            [run_id] => 153
            [user] => advo@ukr.net
            [first_name] => Oleh
            [last_name] => Panko
            [user_id] => 229
            [date] => 2017-04-15 21:00:46
            [time] => 22:20:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 16
            [personal_best] => 22:20:00
        )

    [7] => stdClass Object
        (
            [rank] => 0
            [ID] => 2983
            [run_id] => 151
            [user] => remi@cospot.ge
            [first_name] => Remi
            [last_name] => Boissonnas
            [user_id] => 56
            [date] => 2017-04-15 20:37:22
            [time] => 22:25:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 3
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 11
            [personal_best] => 22:25:00
        )

    [8] => stdClass Object
        (
            [rank] => 0
            [ID] => 2441
            [run_id] => 128
            [user] => delsian@gmail.com
            [first_name] => Alex
            [last_name] => Delsian
            [user_id] => 836
            [date] => 2017-03-11 13:31:20
            [time] => 23:10:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 3
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 13
            [personal_best] => 23:10:00
        )

    [9] => stdClass Object
        (
            [rank] => 0
            [ID] => 2779
            [run_id] => 142
            [user] => alexey.berchatov@gmail.com
            [first_name] => Alexey
            [last_name] => Berchatov
            [user_id] => 916
            [date] => 2017-04-01 11:57:35
            [time] => 23:20:00
            [location_title] => Одеса: Парк Шевченка
            [location_link] => https://runday.org/?post_type=runday_location&p=25771
            [location_id] => 25771
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 23:20:00
        )

    [10] => stdClass Object
        (
            [rank] => 0
            [ID] => 325
            [run_id] => 22
            [user] => hradavies@hotmail.com
            [first_name] => Huw
            [last_name] => Davies
            [user_id] => 298
            [date] => 2016-08-27 11:09:06
            [time] => 24:15:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 24:15:00
        )

    [11] => stdClass Object
        (
            [rank] => 0
            [ID] => 1931
            [run_id] => 100
            [user] => yura240777@i.ua
            [first_name] => Yurii
            [last_name] => Raksha
            [user_id] => 823
            [date] => 2017-01-21 07:36:18
            [time] => 24:54:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 24:54:00
        )

    [12] => stdClass Object
        (
            [rank] => 0
            [ID] => 1717
            [run_id] => 89
            [user] => kravatko@gmail.com
            [first_name] => Руслан
            [last_name] => Рубель
            [user_id] => 764
            [date] => 2016-12-31 11:47:21
            [time] => 27:10:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 27:10:00
        )

    [13] => stdClass Object
        (
            [rank] => 0
            [ID] => 526
            [run_id] => 32
            [user] => mister.walker@yahoo.com
            [first_name] => Richard
            [last_name] => Walker
            [user_id] => 358
            [date] => 2016-09-18 04:20:29
            [time] => 27:34:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 27:34:00
        )

    [14] => stdClass Object
        (
            [rank] => 0
            [ID] => 869
            [run_id] => 44
            [user] => 2236103@gmail.com
            [first_name] => Виталий
            [last_name] => Сластенко
            [user_id] => 386
            [date] => 2016-10-08 09:04:10
            [time] => 28:21:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 10
            [personal_best] => 28:21:00
        )

    [15] => stdClass Object
        (
            [rank] => 0
            [ID] => 346
            [run_id] => 24
            [user] => evgen.bochko@gmail.com
            [first_name] => Євген
            [last_name] => Бочко
            [user_id] => 325
            [date] => 2016-09-03 08:15:36
            [time] => 30:14:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 30:14:00
        )

    [16] => stdClass Object
        (
            [rank] => 0
            [ID] => 267
            [run_id] => 18
            [user] => dj_amadeus@hotmail.com
            [first_name] => Michael
            [last_name] => O'Connell
            [user_id] => 198
            [date] => 2016-08-20 07:28:01
            [time] => 30:22:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 30:22:00
        )

    [17] => stdClass Object
        (
            [rank] => 0
            [ID] => 1727
            [run_id] => 89
            [user] => sag@toursdekiev.com.ua
            [first_name] => Андрій
            [last_name] => Самойлов
            [user_id] => 711
            [date] => 2016-12-31 11:47:21
            [time] => 32:52:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 32:52:00
        )

)
Місце Ім’я Час Локація
1 Євген Євстратьєв 19:59:00 Стрийський парк
2 Stanislav Yerko 20:33:00 Труханів Острів, Київ
3 Патрiк Eванс 21:09:00 Труханів Острів, Київ
4 Sergiy Kutovyy 21:18:00 Труханів Острів, Київ
5 Максим Дзісяк 21:33:00 Тернопіль: Набережна ставу
6 Олександр Медведенко 21:51:00 Труханів Острів, Київ
7 Oleh Panko 22:20:00 Стрийський парк
8 Remi Boissonnas 22:25:00 Труханів Острів, Київ
9 Alex Delsian 23:10:00 Труханів Острів, Київ
10 Alexey Berchatov 23:20:00 Одеса: Парк Шевченка

Жінки

SELECT 
		result.event_place as rank, 
		result.ID, 
		run.ID as run_id, 
		user.display_name as user, 
		first_name.meta_value as first_name, 
		last_name.meta_value as last_name, 
		user.ID as user_id, 
		run.date as date, 
		result.time as time, 
		
		location_post.post_title as location_title, 
		location_post.guid as location_link, 
		location_post.ID as location_id,

		club_post.post_title as club_title,
		club_post.guid as club_link,

		volunteer.volunteered as volunteered,
		is_only_volunteered.value as is_only_volunteered,
		result.volunteered as is_volunteered,
		role.title as volunteer_position,

		runner.runs as runs,

		personal_best.value as personal_best

		FROM (SELECT res1.ID, max(res1.run_id) as run_id, res1.user_id, res1.event_place, res1.time, volunteered, volunteer_position
			FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 40
			            AND datediff(now(), meta_value) / 365.25 < 45
					)
				AND user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_sex'
			            AND meta_value = '2'
					)
				) AS res1
			INNER JOIN (
				SELECT user_id, min(time) as time
	            FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 40
			            AND datediff(now(), meta_value) / 365.25 < 45
					)
				AND user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_sex'
			            AND meta_value = '2'
					)
				) AS res3
	            GROUP BY user_id
				) as res2
			ON (res2.user_id = res1.user_id AND res1.time = res2.time)
			GROUP BY user_id
		) as result
		
		LEFT JOIN wp_runday_run as run
		ON result.run_id = run.ID
		
		LEFT JOIN wp_posts as location_post
		ON run.location_id = location_post.ID
		
		LEFT JOIN wp_users as user
		ON result.user_id = user.ID
		
		LEFT JOIN wp_usermeta as first_name
		ON first_name.user_id = user.ID
	    AND first_name.meta_key = 'first_name'
		
		LEFT JOIN wp_usermeta as last_name
		ON last_name.user_id = user.ID
	    AND last_name.meta_key = 'last_name'
		
		LEFT JOIN wp_usermeta as club
		ON club.user_id = user.ID
	    AND club.meta_key = 'club'
		
		LEFT JOIN wp_posts as club_post
		ON club.meta_value = club_post.post_name
		AND club.meta_value != ''
		AND club_post.post_type = 'runday_club'

		LEFT JOIN (
			SELECT user_id, MIN(volunteered) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as is_only_volunteered
		ON is_only_volunteered.user_id = user.ID

		LEFT JOIN (
			SELECT user_id, MIN(time) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as personal_best
		ON personal_best.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, SUM(volunteered) as volunteered
			FROM (
	            SELECT user_id, MAX(volunteered) AS volunteered
				FROM wp_runday_result
				GROUP BY run_id, user_id) as volunteered_per_run
			GROUP BY user_id
			) as volunteer
		ON volunteer.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, count(*) as runs
			FROM (
	            SELECT user_id
				FROM wp_runday_result
				WHERE volunteered = 0) as only_runs
			GROUP BY user_id
			) as runner
		ON runner.user_id = user.ID

		LEFT JOIN wp_runday_volunteer_positions  as role
		ON result.volunteer_position = role.ID

		WHERE 1 = 1
		 ORDER BY  time ASC, volunteered DESCArray
(
    [0] => stdClass Object
        (
            [rank] => 0
            [ID] => 505
            [run_id] => 31
            [user] => nadysukharyna@live.it
            [first_name] => Надія 
            [last_name] => Сухарина
            [user_id] => 264
            [date] => 2016-09-17 13:15:48
            [time] => 20:08:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 20:08:00
        )

    [1] => stdClass Object
        (
            [rank] => 0
            [ID] => 1118
            [run_id] => 57
            [user] => lob08@ukr.net
            [first_name] => Ольга 
            [last_name] => Лопушевська
            [user_id] => 253
            [date] => 2016-10-29 09:56:09
            [time] => 23:11:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 2
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 19
            [personal_best] => 23:11:00
        )

    [2] => stdClass Object
        (
            [rank] => 0
            [ID] => 901
            [run_id] => 46
            [user] => cmirandal76@gmail.com
            [first_name] => Cristina
            [last_name] => Leicht
            [user_id] => 504
            [date] => 2016-10-15 07:53:58
            [time] => 26:27:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 26:27:00
        )

    [3] => stdClass Object
        (
            [rank] => 0
            [ID] => 902
            [run_id] => 46
            [user] => lanatm1@yandex.ua
            [first_name] => Світлана
            [last_name] => Трофимчук
            [user_id] => 473
            [date] => 2016-10-15 07:53:58
            [time] => 26:45:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 6
            [personal_best] => 26:45:00
        )

    [4] => stdClass Object
        (
            [rank] => 0
            [ID] => 633
            [run_id] => 37
            [user] => sandra.l.cavallo@gmail.com
            [first_name] => Sandra
            [last_name] => Cavallo
            [user_id] => 280
            [date] => 2016-09-24 09:22:59
            [time] => 28:58:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 28:58:00
        )

    [5] => stdClass Object
        (
            [rank] => 0
            [ID] => 3525
            [run_id] => 185
            [user] => Yanulya_Guapa@ukr.net
            [first_name] => Галина
            [last_name] => Щепанівська
            [user_id] => 584
            [date] => 2017-05-20 12:47:32
            [time] => 29:17:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 29:17:00
        )

    [6] => stdClass Object
        (
            [rank] => 0
            [ID] => 1782
            [run_id] => 90
            [user] => yulchik1975@ukr.net
            [first_name] => Юлія
            [last_name] => Сумко
            [user_id] => 741
            [date] => 2016-12-31 11:55:01
            [time] => 31:52:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 31:52:00
        )

    [7] => stdClass Object
        (
            [rank] => 0
            [ID] => 512
            [run_id] => 31
            [user] => biley@list.ru
            [first_name] => Анна
            [last_name] => Білей
            [user_id] => 188
            [date] => 2016-09-17 13:15:48
            [time] => 37:52:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 7
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 37:52:00
        )

)
Місце Ім’я Час Локація
1 Надія Сухарина 20:08:00 Стрийський парк
2 Ольга Лопушевська 23:11:00 Стрийський парк
3 Cristina Leicht 26:27:00 Труханів Острів, Київ
4 Світлана Трофимчук 26:45:00 Труханів Острів, Київ
5 Sandra Cavallo 28:58:00 Труханів Острів, Київ
6 Галина Щепанівська 29:17:00 Тернопіль: Набережна ставу
7 Юлія Сумко 31:52:00 Стрийський парк
8 Анна Білей 37:52:00 Стрийський парк

44-49.

Топ – 10

SELECT 
		result.event_place as rank, 
		result.ID, 
		run.ID as run_id, 
		user.display_name as user, 
		first_name.meta_value as first_name, 
		last_name.meta_value as last_name, 
		user.ID as user_id, 
		run.date as date, 
		result.time as time, 
		
		location_post.post_title as location_title, 
		location_post.guid as location_link, 
		location_post.ID as location_id,

		club_post.post_title as club_title,
		club_post.guid as club_link,

		volunteer.volunteered as volunteered,
		is_only_volunteered.value as is_only_volunteered,
		result.volunteered as is_volunteered,
		role.title as volunteer_position,

		runner.runs as runs,

		personal_best.value as personal_best

		FROM (SELECT res1.ID, max(res1.run_id) as run_id, res1.user_id, res1.event_place, res1.time, volunteered, volunteer_position
			FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 45
			            AND datediff(now(), meta_value) / 365.25 < 50
					)
				
				) AS res1
			INNER JOIN (
				SELECT user_id, min(time) as time
	            FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 45
			            AND datediff(now(), meta_value) / 365.25 < 50
					)
				
				) AS res3
	            GROUP BY user_id
				) as res2
			ON (res2.user_id = res1.user_id AND res1.time = res2.time)
			GROUP BY user_id
		) as result
		
		LEFT JOIN wp_runday_run as run
		ON result.run_id = run.ID
		
		LEFT JOIN wp_posts as location_post
		ON run.location_id = location_post.ID
		
		LEFT JOIN wp_users as user
		ON result.user_id = user.ID
		
		LEFT JOIN wp_usermeta as first_name
		ON first_name.user_id = user.ID
	    AND first_name.meta_key = 'first_name'
		
		LEFT JOIN wp_usermeta as last_name
		ON last_name.user_id = user.ID
	    AND last_name.meta_key = 'last_name'
		
		LEFT JOIN wp_usermeta as club
		ON club.user_id = user.ID
	    AND club.meta_key = 'club'
		
		LEFT JOIN wp_posts as club_post
		ON club.meta_value = club_post.post_name
		AND club.meta_value != ''
		AND club_post.post_type = 'runday_club'

		LEFT JOIN (
			SELECT user_id, MIN(volunteered) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as is_only_volunteered
		ON is_only_volunteered.user_id = user.ID

		LEFT JOIN (
			SELECT user_id, MIN(time) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as personal_best
		ON personal_best.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, SUM(volunteered) as volunteered
			FROM (
	            SELECT user_id, MAX(volunteered) AS volunteered
				FROM wp_runday_result
				GROUP BY run_id, user_id) as volunteered_per_run
			GROUP BY user_id
			) as volunteer
		ON volunteer.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, count(*) as runs
			FROM (
	            SELECT user_id
				FROM wp_runday_result
				WHERE volunteered = 0) as only_runs
			GROUP BY user_id
			) as runner
		ON runner.user_id = user.ID

		LEFT JOIN wp_runday_volunteer_positions  as role
		ON result.volunteer_position = role.ID

		WHERE 1 = 1
		 ORDER BY  time ASC, volunteered DESCArray
(
    [0] => stdClass Object
        (
            [rank] => 0
            [ID] => 646
            [run_id] => 38
            [user] => panchenko71@mail.ru
            [first_name] => Сергій
            [last_name] => Панченко
            [user_id] => 274
            [date] => 2016-10-01 09:22:43
            [time] => 17:06:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 16
            [personal_best] => 17:06:00
        )

    [1] => stdClass Object
        (
            [rank] => 0
            [ID] => 1136
            [run_id] => 58
            [user] => michele@sweetway.pl
            [first_name] => Mieczyslaw
            [last_name] => Goral
            [user_id] => 557
            [date] => 2016-11-05 09:26:08
            [time] => 19:19:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 13
            [personal_best] => 19:19:00
        )

    [2] => stdClass Object
        (
            [rank] => 0
            [ID] => 4492
            [run_id] => 249
            [user] => karavella71@mail.ru
            [first_name] => ігор
            [last_name] => мрикало
            [user_id] => 695
            [date] => 2017-07-22 22:51:34
            [time] => 20:18:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 16
            [personal_best] => 20:18:00
        )

    [3] => stdClass Object
        (
            [rank] => 0
            [ID] => 3192
            [run_id] => 166
            [user] => romanchepipl68@gmail.com
            [first_name] => Роман
            [last_name] => Чепіль
            [user_id] => 905
            [date] => 2017-04-29 10:34:06
            [time] => 20:32:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 20:32:00
        )

    [4] => stdClass Object
        (
            [rank] => 0
            [ID] => 650
            [run_id] => 38
            [user] => a.gavryliv@gmail.com
            [first_name] => Андрій
            [last_name] => Гаврилів
            [user_id] => 406
            [date] => 2016-10-01 09:22:43
            [time] => 21:09:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 21:09:00
        )

    [5] => stdClass Object
        (
            [rank] => 0
            [ID] => 4170
            [run_id] => 227
            [user] => e72@bigmir.net
            [first_name] => Vladyslav
            [last_name] => Kuraiev
            [user_id] => 1587
            [date] => 2017-07-01 12:06:08
            [time] => 21:32:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 21:32:00
        )

    [6] => stdClass Object
        (
            [rank] => 0
            [ID] => 321
            [run_id] => 22
            [user] => andriy.spizhovyy@dtz.kiev.ua
            [first_name] => Андрій
            [last_name] => Спіжовий
            [user_id] => 150
            [date] => 2016-08-27 11:09:06
            [time] => 21:34:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 21:34:00
        )

    [7] => stdClass Object
        (
            [rank] => 0
            [ID] => 898
            [run_id] => 46
            [user] => claitinen@hotmail.com
            [first_name] => Chip
            [last_name] => Laitinen
            [user_id] => 519
            [date] => 2016-10-15 07:53:58
            [time] => 21:46:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 21:46:00
        )

    [8] => stdClass Object
        (
            [rank] => 0
            [ID] => 3302
            [run_id] => 173
            [user] => diavam@ukr.net
            [first_name] => Валерій
            [last_name] => Дяченко
            [user_id] => 643
            [date] => 2017-05-06 08:30:16
            [time] => 21:58:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 4
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 16
            [personal_best] => 21:58:00
        )

    [9] => stdClass Object
        (
            [rank] => 0
            [ID] => 2778
            [run_id] => 142
            [user] => AM.Odessa@list.ru
            [first_name] => Александр
            [last_name] => Макущенко
            [user_id] => 1108
            [date] => 2017-04-01 11:57:35
            [time] => 22:24:00
            [location_title] => Одеса: Парк Шевченка
            [location_link] => https://runday.org/?post_type=runday_location&p=25771
            [location_id] => 25771
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 22:24:00
        )

    [10] => stdClass Object
        (
            [rank] => 0
            [ID] => 2359
            [run_id] => 125
            [user] => adyo@ukr.net
            [first_name] => андрій
            [last_name] => василько
            [user_id] => 868
            [date] => 2017-03-04 21:55:09
            [time] => 23:14:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 23:14:00
        )

    [11] => stdClass Object
        (
            [rank] => 0
            [ID] => 629
            [run_id] => 37
            [user] => valeria_laitinen@hotmail.com
            [first_name] => Valeria
            [last_name] => Laitinen
            [user_id] => 349
            [date] => 2016-09-24 09:22:59
            [time] => 25:09:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => PSI Panthers Cross Country Team
            [club_link] => https://runday.org/?post_type=runday_club&p=24884
            [volunteered] => 1
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 25:09:00
        )

    [12] => stdClass Object
        (
            [rank] => 0
            [ID] => 783
            [run_id] => 43
            [user] => dmiroslavsky@gmail.com
            [first_name] => Денис
            [last_name] => Миро
            [user_id] => 333
            [date] => 2016-10-01 12:24:56
            [time] => 25:14:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 25:14:00
        )

    [13] => stdClass Object
        (
            [rank] => 0
            [ID] => 3686
            [run_id] => 196
            [user] => vitalis333@gmail.com
            [first_name] => Vitaliy
            [last_name] => Lisen
            [user_id] => 838
            [date] => 2017-05-27 19:56:10
            [time] => 25:26:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 25:26:00
        )

    [14] => stdClass Object
        (
            [rank] => 0
            [ID] => 2879
            [run_id] => 145
            [user] => Lanazimskay@gmail.com
            [first_name] => Светлана
            [last_name] => Шевченко
            [user_id] => 870
            [date] => 2017-04-08 08:01:31
            [time] => 25:30:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 6
            [personal_best] => 25:30:00
        )

    [15] => stdClass Object
        (
            [rank] => 0
            [ID] => 3604
            [run_id] => 190
            [user] => olena-rubanova@ukr.qsi.org
            [first_name] => olena
            [last_name] => rubanova
            [user_id] => 768
            [date] => 2017-05-20 17:55:38
            [time] => 25:51:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 25:51:00
        )

    [16] => stdClass Object
        (
            [rank] => 0
            [ID] => 971
            [run_id] => 49
            [user] => lena-kuts@ukr.net
            [first_name] => Олена
            [last_name] => Куць
            [user_id] => 314
            [date] => 2016-10-22 09:11:07
            [time] => 28:00:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 12
            [personal_best] => 28:00:00
        )

    [17] => stdClass Object
        (
            [rank] => 0
            [ID] => 1722
            [run_id] => 89
            [user] => Agroteh06@mail.ru
            [first_name] => наталья
            [last_name] => Жолоб
            [user_id] => 721
            [date] => 2016-12-31 11:47:21
            [time] => 29:08:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 29:08:00
        )

    [18] => stdClass Object
        (
            [rank] => 0
            [ID] => 348
            [run_id] => 24
            [user] => anastasiya.klimashevska@chiltern.com
            [first_name] => Anastasiya 
            [last_name] => Klimashevska
            [user_id] => 128
            [date] => 2016-09-03 08:15:36
            [time] => 31:25:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 31:25:00
        )

    [19] => stdClass Object
        (
            [rank] => 0
            [ID] => 207
            [run_id] => 15
            [user] => stadnikolka@ukr.net
            [first_name] => Ольга
            [last_name] => Стаднік
            [user_id] => 126
            [date] => 2016-08-13 09:16:59
            [time] => 34:15:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 34:15:00
        )

)
Місце Ім’я Час Локація
1 Сергій Панченко 17:06:00 Стрийський парк
2 Mieczyslaw Goral 19:19:00 Стрийський парк
3 ігор мрикало 20:18:00 Тернопіль: Набережна ставу
4 Роман Чепіль 20:32:00 Стрийський парк
5 Андрій Гаврилів 21:09:00 Стрийський парк
6 Vladyslav Kuraiev 21:32:00 Труханів Острів, Київ
7 Андрій Спіжовий 21:34:00 Труханів Острів, Київ
8 Chip Laitinen 21:46:00 Труханів Острів, Київ
9 Валерій Дяченко 21:58:00 Труханів Острів, Київ
10 Александр Макущенко 22:24:00 Одеса: Парк Шевченка

Чоловіки

SELECT 
		result.event_place as rank, 
		result.ID, 
		run.ID as run_id, 
		user.display_name as user, 
		first_name.meta_value as first_name, 
		last_name.meta_value as last_name, 
		user.ID as user_id, 
		run.date as date, 
		result.time as time, 
		
		location_post.post_title as location_title, 
		location_post.guid as location_link, 
		location_post.ID as location_id,

		club_post.post_title as club_title,
		club_post.guid as club_link,

		volunteer.volunteered as volunteered,
		is_only_volunteered.value as is_only_volunteered,
		result.volunteered as is_volunteered,
		role.title as volunteer_position,

		runner.runs as runs,

		personal_best.value as personal_best

		FROM (SELECT res1.ID, max(res1.run_id) as run_id, res1.user_id, res1.event_place, res1.time, volunteered, volunteer_position
			FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 45
			            AND datediff(now(), meta_value) / 365.25 < 50
					)
				AND user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_sex'
			            AND meta_value = '1'
					)
				) AS res1
			INNER JOIN (
				SELECT user_id, min(time) as time
	            FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 45
			            AND datediff(now(), meta_value) / 365.25 < 50
					)
				AND user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_sex'
			            AND meta_value = '1'
					)
				) AS res3
	            GROUP BY user_id
				) as res2
			ON (res2.user_id = res1.user_id AND res1.time = res2.time)
			GROUP BY user_id
		) as result
		
		LEFT JOIN wp_runday_run as run
		ON result.run_id = run.ID
		
		LEFT JOIN wp_posts as location_post
		ON run.location_id = location_post.ID
		
		LEFT JOIN wp_users as user
		ON result.user_id = user.ID
		
		LEFT JOIN wp_usermeta as first_name
		ON first_name.user_id = user.ID
	    AND first_name.meta_key = 'first_name'
		
		LEFT JOIN wp_usermeta as last_name
		ON last_name.user_id = user.ID
	    AND last_name.meta_key = 'last_name'
		
		LEFT JOIN wp_usermeta as club
		ON club.user_id = user.ID
	    AND club.meta_key = 'club'
		
		LEFT JOIN wp_posts as club_post
		ON club.meta_value = club_post.post_name
		AND club.meta_value != ''
		AND club_post.post_type = 'runday_club'

		LEFT JOIN (
			SELECT user_id, MIN(volunteered) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as is_only_volunteered
		ON is_only_volunteered.user_id = user.ID

		LEFT JOIN (
			SELECT user_id, MIN(time) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as personal_best
		ON personal_best.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, SUM(volunteered) as volunteered
			FROM (
	            SELECT user_id, MAX(volunteered) AS volunteered
				FROM wp_runday_result
				GROUP BY run_id, user_id) as volunteered_per_run
			GROUP BY user_id
			) as volunteer
		ON volunteer.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, count(*) as runs
			FROM (
	            SELECT user_id
				FROM wp_runday_result
				WHERE volunteered = 0) as only_runs
			GROUP BY user_id
			) as runner
		ON runner.user_id = user.ID

		LEFT JOIN wp_runday_volunteer_positions  as role
		ON result.volunteer_position = role.ID

		WHERE 1 = 1
		 ORDER BY  time ASC, volunteered DESCArray
(
    [0] => stdClass Object
        (
            [rank] => 0
            [ID] => 646
            [run_id] => 38
            [user] => panchenko71@mail.ru
            [first_name] => Сергій
            [last_name] => Панченко
            [user_id] => 274
            [date] => 2016-10-01 09:22:43
            [time] => 17:06:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 16
            [personal_best] => 17:06:00
        )

    [1] => stdClass Object
        (
            [rank] => 0
            [ID] => 1136
            [run_id] => 58
            [user] => michele@sweetway.pl
            [first_name] => Mieczyslaw
            [last_name] => Goral
            [user_id] => 557
            [date] => 2016-11-05 09:26:08
            [time] => 19:19:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 13
            [personal_best] => 19:19:00
        )

    [2] => stdClass Object
        (
            [rank] => 0
            [ID] => 4492
            [run_id] => 249
            [user] => karavella71@mail.ru
            [first_name] => ігор
            [last_name] => мрикало
            [user_id] => 695
            [date] => 2017-07-22 22:51:34
            [time] => 20:18:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 16
            [personal_best] => 20:18:00
        )

    [3] => stdClass Object
        (
            [rank] => 0
            [ID] => 3192
            [run_id] => 166
            [user] => romanchepipl68@gmail.com
            [first_name] => Роман
            [last_name] => Чепіль
            [user_id] => 905
            [date] => 2017-04-29 10:34:06
            [time] => 20:32:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 20:32:00
        )

    [4] => stdClass Object
        (
            [rank] => 0
            [ID] => 650
            [run_id] => 38
            [user] => a.gavryliv@gmail.com
            [first_name] => Андрій
            [last_name] => Гаврилів
            [user_id] => 406
            [date] => 2016-10-01 09:22:43
            [time] => 21:09:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 21:09:00
        )

    [5] => stdClass Object
        (
            [rank] => 0
            [ID] => 4170
            [run_id] => 227
            [user] => e72@bigmir.net
            [first_name] => Vladyslav
            [last_name] => Kuraiev
            [user_id] => 1587
            [date] => 2017-07-01 12:06:08
            [time] => 21:32:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 21:32:00
        )

    [6] => stdClass Object
        (
            [rank] => 0
            [ID] => 321
            [run_id] => 22
            [user] => andriy.spizhovyy@dtz.kiev.ua
            [first_name] => Андрій
            [last_name] => Спіжовий
            [user_id] => 150
            [date] => 2016-08-27 11:09:06
            [time] => 21:34:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 21:34:00
        )

    [7] => stdClass Object
        (
            [rank] => 0
            [ID] => 898
            [run_id] => 46
            [user] => claitinen@hotmail.com
            [first_name] => Chip
            [last_name] => Laitinen
            [user_id] => 519
            [date] => 2016-10-15 07:53:58
            [time] => 21:46:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 21:46:00
        )

    [8] => stdClass Object
        (
            [rank] => 0
            [ID] => 3302
            [run_id] => 173
            [user] => diavam@ukr.net
            [first_name] => Валерій
            [last_name] => Дяченко
            [user_id] => 643
            [date] => 2017-05-06 08:30:16
            [time] => 21:58:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 4
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 16
            [personal_best] => 21:58:00
        )

    [9] => stdClass Object
        (
            [rank] => 0
            [ID] => 2778
            [run_id] => 142
            [user] => AM.Odessa@list.ru
            [first_name] => Александр
            [last_name] => Макущенко
            [user_id] => 1108
            [date] => 2017-04-01 11:57:35
            [time] => 22:24:00
            [location_title] => Одеса: Парк Шевченка
            [location_link] => https://runday.org/?post_type=runday_location&p=25771
            [location_id] => 25771
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 22:24:00
        )

    [10] => stdClass Object
        (
            [rank] => 0
            [ID] => 2359
            [run_id] => 125
            [user] => adyo@ukr.net
            [first_name] => андрій
            [last_name] => василько
            [user_id] => 868
            [date] => 2017-03-04 21:55:09
            [time] => 23:14:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 23:14:00
        )

    [11] => stdClass Object
        (
            [rank] => 0
            [ID] => 783
            [run_id] => 43
            [user] => dmiroslavsky@gmail.com
            [first_name] => Денис
            [last_name] => Миро
            [user_id] => 333
            [date] => 2016-10-01 12:24:56
            [time] => 25:14:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 25:14:00
        )

    [12] => stdClass Object
        (
            [rank] => 0
            [ID] => 3686
            [run_id] => 196
            [user] => vitalis333@gmail.com
            [first_name] => Vitaliy
            [last_name] => Lisen
            [user_id] => 838
            [date] => 2017-05-27 19:56:10
            [time] => 25:26:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 25:26:00
        )

)
Місце Ім’я Час Локація
1 Сергій Панченко 17:06:00 Стрийський парк
2 Mieczyslaw Goral 19:19:00 Стрийський парк
3 ігор мрикало 20:18:00 Тернопіль: Набережна ставу
4 Роман Чепіль 20:32:00 Стрийський парк
5 Андрій Гаврилів 21:09:00 Стрийський парк
6 Vladyslav Kuraiev 21:32:00 Труханів Острів, Київ
7 Андрій Спіжовий 21:34:00 Труханів Острів, Київ
8 Chip Laitinen 21:46:00 Труханів Острів, Київ
9 Валерій Дяченко 21:58:00 Труханів Острів, Київ
10 Александр Макущенко 22:24:00 Одеса: Парк Шевченка

Жінки

SELECT 
		result.event_place as rank, 
		result.ID, 
		run.ID as run_id, 
		user.display_name as user, 
		first_name.meta_value as first_name, 
		last_name.meta_value as last_name, 
		user.ID as user_id, 
		run.date as date, 
		result.time as time, 
		
		location_post.post_title as location_title, 
		location_post.guid as location_link, 
		location_post.ID as location_id,

		club_post.post_title as club_title,
		club_post.guid as club_link,

		volunteer.volunteered as volunteered,
		is_only_volunteered.value as is_only_volunteered,
		result.volunteered as is_volunteered,
		role.title as volunteer_position,

		runner.runs as runs,

		personal_best.value as personal_best

		FROM (SELECT res1.ID, max(res1.run_id) as run_id, res1.user_id, res1.event_place, res1.time, volunteered, volunteer_position
			FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 45
			            AND datediff(now(), meta_value) / 365.25 < 50
					)
				AND user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_sex'
			            AND meta_value = '2'
					)
				) AS res1
			INNER JOIN (
				SELECT user_id, min(time) as time
	            FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 45
			            AND datediff(now(), meta_value) / 365.25 < 50
					)
				AND user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_sex'
			            AND meta_value = '2'
					)
				) AS res3
	            GROUP BY user_id
				) as res2
			ON (res2.user_id = res1.user_id AND res1.time = res2.time)
			GROUP BY user_id
		) as result
		
		LEFT JOIN wp_runday_run as run
		ON result.run_id = run.ID
		
		LEFT JOIN wp_posts as location_post
		ON run.location_id = location_post.ID
		
		LEFT JOIN wp_users as user
		ON result.user_id = user.ID
		
		LEFT JOIN wp_usermeta as first_name
		ON first_name.user_id = user.ID
	    AND first_name.meta_key = 'first_name'
		
		LEFT JOIN wp_usermeta as last_name
		ON last_name.user_id = user.ID
	    AND last_name.meta_key = 'last_name'
		
		LEFT JOIN wp_usermeta as club
		ON club.user_id = user.ID
	    AND club.meta_key = 'club'
		
		LEFT JOIN wp_posts as club_post
		ON club.meta_value = club_post.post_name
		AND club.meta_value != ''
		AND club_post.post_type = 'runday_club'

		LEFT JOIN (
			SELECT user_id, MIN(volunteered) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as is_only_volunteered
		ON is_only_volunteered.user_id = user.ID

		LEFT JOIN (
			SELECT user_id, MIN(time) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as personal_best
		ON personal_best.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, SUM(volunteered) as volunteered
			FROM (
	            SELECT user_id, MAX(volunteered) AS volunteered
				FROM wp_runday_result
				GROUP BY run_id, user_id) as volunteered_per_run
			GROUP BY user_id
			) as volunteer
		ON volunteer.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, count(*) as runs
			FROM (
	            SELECT user_id
				FROM wp_runday_result
				WHERE volunteered = 0) as only_runs
			GROUP BY user_id
			) as runner
		ON runner.user_id = user.ID

		LEFT JOIN wp_runday_volunteer_positions  as role
		ON result.volunteer_position = role.ID

		WHERE 1 = 1
		 ORDER BY  time ASC, volunteered DESCArray
(
    [0] => stdClass Object
        (
            [rank] => 0
            [ID] => 629
            [run_id] => 37
            [user] => valeria_laitinen@hotmail.com
            [first_name] => Valeria
            [last_name] => Laitinen
            [user_id] => 349
            [date] => 2016-09-24 09:22:59
            [time] => 25:09:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => PSI Panthers Cross Country Team
            [club_link] => https://runday.org/?post_type=runday_club&p=24884
            [volunteered] => 1
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 25:09:00
        )

    [1] => stdClass Object
        (
            [rank] => 0
            [ID] => 2879
            [run_id] => 145
            [user] => Lanazimskay@gmail.com
            [first_name] => Светлана
            [last_name] => Шевченко
            [user_id] => 870
            [date] => 2017-04-08 08:01:31
            [time] => 25:30:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 6
            [personal_best] => 25:30:00
        )

    [2] => stdClass Object
        (
            [rank] => 0
            [ID] => 3604
            [run_id] => 190
            [user] => olena-rubanova@ukr.qsi.org
            [first_name] => olena
            [last_name] => rubanova
            [user_id] => 768
            [date] => 2017-05-20 17:55:38
            [time] => 25:51:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 25:51:00
        )

    [3] => stdClass Object
        (
            [rank] => 0
            [ID] => 971
            [run_id] => 49
            [user] => lena-kuts@ukr.net
            [first_name] => Олена
            [last_name] => Куць
            [user_id] => 314
            [date] => 2016-10-22 09:11:07
            [time] => 28:00:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 12
            [personal_best] => 28:00:00
        )

    [4] => stdClass Object
        (
            [rank] => 0
            [ID] => 1722
            [run_id] => 89
            [user] => Agroteh06@mail.ru
            [first_name] => наталья
            [last_name] => Жолоб
            [user_id] => 721
            [date] => 2016-12-31 11:47:21
            [time] => 29:08:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 29:08:00
        )

    [5] => stdClass Object
        (
            [rank] => 0
            [ID] => 348
            [run_id] => 24
            [user] => anastasiya.klimashevska@chiltern.com
            [first_name] => Anastasiya 
            [last_name] => Klimashevska
            [user_id] => 128
            [date] => 2016-09-03 08:15:36
            [time] => 31:25:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 31:25:00
        )

    [6] => stdClass Object
        (
            [rank] => 0
            [ID] => 207
            [run_id] => 15
            [user] => stadnikolka@ukr.net
            [first_name] => Ольга
            [last_name] => Стаднік
            [user_id] => 126
            [date] => 2016-08-13 09:16:59
            [time] => 34:15:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 34:15:00
        )

)
Місце Ім’я Час Локація
1 Valeria Laitinen 25:09:00 Труханів Острів, Київ
2 Светлана Шевченко 25:30:00 Труханів Острів, Київ
3 olena rubanova 25:51:00 Труханів Острів, Київ
4 Олена Куць 28:00:00 Труханів Острів, Київ
5 наталья Жолоб 29:08:00 Труханів Острів, Київ
6 Anastasiya Klimashevska 31:25:00 Труханів Острів, Київ
7 Ольга Стаднік 34:15:00 Труханів Острів, Київ

50-54.

Всі

SELECT 
		result.event_place as rank, 
		result.ID, 
		run.ID as run_id, 
		user.display_name as user, 
		first_name.meta_value as first_name, 
		last_name.meta_value as last_name, 
		user.ID as user_id, 
		run.date as date, 
		result.time as time, 
		
		location_post.post_title as location_title, 
		location_post.guid as location_link, 
		location_post.ID as location_id,

		club_post.post_title as club_title,
		club_post.guid as club_link,

		volunteer.volunteered as volunteered,
		is_only_volunteered.value as is_only_volunteered,
		result.volunteered as is_volunteered,
		role.title as volunteer_position,

		runner.runs as runs,

		personal_best.value as personal_best

		FROM (SELECT res1.ID, max(res1.run_id) as run_id, res1.user_id, res1.event_place, res1.time, volunteered, volunteer_position
			FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 50
			            AND datediff(now(), meta_value) / 365.25 < 55
					)
				
				) AS res1
			INNER JOIN (
				SELECT user_id, min(time) as time
	            FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 50
			            AND datediff(now(), meta_value) / 365.25 < 55
					)
				
				) AS res3
	            GROUP BY user_id
				) as res2
			ON (res2.user_id = res1.user_id AND res1.time = res2.time)
			GROUP BY user_id
		) as result
		
		LEFT JOIN wp_runday_run as run
		ON result.run_id = run.ID
		
		LEFT JOIN wp_posts as location_post
		ON run.location_id = location_post.ID
		
		LEFT JOIN wp_users as user
		ON result.user_id = user.ID
		
		LEFT JOIN wp_usermeta as first_name
		ON first_name.user_id = user.ID
	    AND first_name.meta_key = 'first_name'
		
		LEFT JOIN wp_usermeta as last_name
		ON last_name.user_id = user.ID
	    AND last_name.meta_key = 'last_name'
		
		LEFT JOIN wp_usermeta as club
		ON club.user_id = user.ID
	    AND club.meta_key = 'club'
		
		LEFT JOIN wp_posts as club_post
		ON club.meta_value = club_post.post_name
		AND club.meta_value != ''
		AND club_post.post_type = 'runday_club'

		LEFT JOIN (
			SELECT user_id, MIN(volunteered) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as is_only_volunteered
		ON is_only_volunteered.user_id = user.ID

		LEFT JOIN (
			SELECT user_id, MIN(time) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as personal_best
		ON personal_best.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, SUM(volunteered) as volunteered
			FROM (
	            SELECT user_id, MAX(volunteered) AS volunteered
				FROM wp_runday_result
				GROUP BY run_id, user_id) as volunteered_per_run
			GROUP BY user_id
			) as volunteer
		ON volunteer.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, count(*) as runs
			FROM (
	            SELECT user_id
				FROM wp_runday_result
				WHERE volunteered = 0) as only_runs
			GROUP BY user_id
			) as runner
		ON runner.user_id = user.ID

		LEFT JOIN wp_runday_volunteer_positions  as role
		ON result.volunteer_position = role.ID

		WHERE 1 = 1
		 ORDER BY  time ASC, volunteered DESCArray
(
    [0] => stdClass Object
        (
            [rank] => 0
            [ID] => 1110
            [run_id] => 57
            [user] => bekass263@gmail.com
            [first_name] => Олександр
            [last_name] => Бобрицький
            [user_id] => 550
            [date] => 2016-10-29 09:56:09
            [time] => 20:49:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 22
            [personal_best] => 20:49:00
        )

    [1] => stdClass Object
        (
            [rank] => 0
            [ID] => 4350
            [run_id] => 241
            [user] => steppenwolf63@gmail.com
            [first_name] => Олександр
            [last_name] => Волков
            [user_id] => 866
            [date] => 2017-07-08 20:02:59
            [time] => 21:59:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 7
            [personal_best] => 21:59:00
        )

    [2] => stdClass Object
        (
            [rank] => 0
            [ID] => 2168
            [run_id] => 115
            [user] => liza_garmash@mail.ru
            [first_name] => Віктор
            [last_name] => Гармаш
            [user_id] => 806
            [date] => 2017-02-18 23:09:16
            [time] => 22:52:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 5
            [personal_best] => 22:52:00
        )

    [3] => stdClass Object
        (
            [rank] => 0
            [ID] => 1704
            [run_id] => 89
            [user] => zholob-i@mail.ru
            [first_name] => Ігор
            [last_name] => Жолоб
            [user_id] => 723
            [date] => 2016-12-31 11:47:21
            [time] => 23:00:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 23:00:00
        )

    [4] => stdClass Object
        (
            [rank] => 0
            [ID] => 2541
            [run_id] => 134
            [user] => ibugryn@ukr.net
            [first_name] => Ігор
            [last_name] => Бугрин
            [user_id] => 965
            [date] => 2017-03-25 23:57:24
            [time] => 23:48:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 23:48:00
        )

    [5] => stdClass Object
        (
            [rank] => 0
            [ID] => 782
            [run_id] => 43
            [user] => valeri_n@icloud.com
            [first_name] => Валерій
            [last_name] => Новіков
            [user_id] => 215
            [date] => 2016-10-01 12:24:56
            [time] => 24:51:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 24:51:00
        )

    [6] => stdClass Object
        (
            [rank] => 4
            [ID] => 51
            [run_id] => 8
            [user] => sgusovsky@yahoo.com
            [first_name] => Сергій
            [last_name] => Гусовський
            [user_id] => 80
            [date] => 2016-07-30 07:58:33
            [time] => 25:38:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 25:38:00
        )

    [7] => stdClass Object
        (
            [rank] => 0
            [ID] => 530
            [run_id] => 32
            [user] => babichalex62@gmail.com
            [first_name] => Александр
            [last_name] => Бабич
            [user_id] => 172
            [date] => 2016-09-18 04:20:29
            [time] => 30:55:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 6
            [personal_best] => 30:55:00
        )

    [8] => stdClass Object
        (
            [rank] => 0
            [ID] => 1733
            [run_id] => 89
            [user] => ukraine.sergey@yahoo.com
            [first_name] => SERHII
            [last_name] => KURYLIUK
            [user_id] => 760
            [date] => 2016-12-31 11:47:21
            [time] => 36:33:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 36:33:00
        )

)
Місце Ім’я Час Локація
1 Олександр Бобрицький 20:49:00 Стрийський парк
2 Олександр Волков 21:59:00 Труханів Острів, Київ
3 Віктор Гармаш 22:52:00 Труханів Острів, Київ
4 Ігор Жолоб 23:00:00 Труханів Острів, Київ
5 Ігор Бугрин 23:48:00 Стрийський парк
6 Валерій Новіков 24:51:00 Труханів Острів, Київ
7 Сергій Гусовський 25:38:00 Труханів Острів, Київ
8 Александр Бабич 30:55:00 Труханів Острів, Київ
9 SERHII KURYLIUK 36:33:00 Труханів Острів, Київ

Чоловіки

SELECT 
		result.event_place as rank, 
		result.ID, 
		run.ID as run_id, 
		user.display_name as user, 
		first_name.meta_value as first_name, 
		last_name.meta_value as last_name, 
		user.ID as user_id, 
		run.date as date, 
		result.time as time, 
		
		location_post.post_title as location_title, 
		location_post.guid as location_link, 
		location_post.ID as location_id,

		club_post.post_title as club_title,
		club_post.guid as club_link,

		volunteer.volunteered as volunteered,
		is_only_volunteered.value as is_only_volunteered,
		result.volunteered as is_volunteered,
		role.title as volunteer_position,

		runner.runs as runs,

		personal_best.value as personal_best

		FROM (SELECT res1.ID, max(res1.run_id) as run_id, res1.user_id, res1.event_place, res1.time, volunteered, volunteer_position
			FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 50
			            AND datediff(now(), meta_value) / 365.25 < 55
					)
				AND user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_sex'
			            AND meta_value = '1'
					)
				) AS res1
			INNER JOIN (
				SELECT user_id, min(time) as time
	            FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 50
			            AND datediff(now(), meta_value) / 365.25 < 55
					)
				AND user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_sex'
			            AND meta_value = '1'
					)
				) AS res3
	            GROUP BY user_id
				) as res2
			ON (res2.user_id = res1.user_id AND res1.time = res2.time)
			GROUP BY user_id
		) as result
		
		LEFT JOIN wp_runday_run as run
		ON result.run_id = run.ID
		
		LEFT JOIN wp_posts as location_post
		ON run.location_id = location_post.ID
		
		LEFT JOIN wp_users as user
		ON result.user_id = user.ID
		
		LEFT JOIN wp_usermeta as first_name
		ON first_name.user_id = user.ID
	    AND first_name.meta_key = 'first_name'
		
		LEFT JOIN wp_usermeta as last_name
		ON last_name.user_id = user.ID
	    AND last_name.meta_key = 'last_name'
		
		LEFT JOIN wp_usermeta as club
		ON club.user_id = user.ID
	    AND club.meta_key = 'club'
		
		LEFT JOIN wp_posts as club_post
		ON club.meta_value = club_post.post_name
		AND club.meta_value != ''
		AND club_post.post_type = 'runday_club'

		LEFT JOIN (
			SELECT user_id, MIN(volunteered) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as is_only_volunteered
		ON is_only_volunteered.user_id = user.ID

		LEFT JOIN (
			SELECT user_id, MIN(time) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as personal_best
		ON personal_best.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, SUM(volunteered) as volunteered
			FROM (
	            SELECT user_id, MAX(volunteered) AS volunteered
				FROM wp_runday_result
				GROUP BY run_id, user_id) as volunteered_per_run
			GROUP BY user_id
			) as volunteer
		ON volunteer.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, count(*) as runs
			FROM (
	            SELECT user_id
				FROM wp_runday_result
				WHERE volunteered = 0) as only_runs
			GROUP BY user_id
			) as runner
		ON runner.user_id = user.ID

		LEFT JOIN wp_runday_volunteer_positions  as role
		ON result.volunteer_position = role.ID

		WHERE 1 = 1
		 ORDER BY  time ASC, volunteered DESCArray
(
    [0] => stdClass Object
        (
            [rank] => 0
            [ID] => 1110
            [run_id] => 57
            [user] => bekass263@gmail.com
            [first_name] => Олександр
            [last_name] => Бобрицький
            [user_id] => 550
            [date] => 2016-10-29 09:56:09
            [time] => 20:49:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 22
            [personal_best] => 20:49:00
        )

    [1] => stdClass Object
        (
            [rank] => 0
            [ID] => 4350
            [run_id] => 241
            [user] => steppenwolf63@gmail.com
            [first_name] => Олександр
            [last_name] => Волков
            [user_id] => 866
            [date] => 2017-07-08 20:02:59
            [time] => 21:59:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 7
            [personal_best] => 21:59:00
        )

    [2] => stdClass Object
        (
            [rank] => 0
            [ID] => 2168
            [run_id] => 115
            [user] => liza_garmash@mail.ru
            [first_name] => Віктор
            [last_name] => Гармаш
            [user_id] => 806
            [date] => 2017-02-18 23:09:16
            [time] => 22:52:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 5
            [personal_best] => 22:52:00
        )

    [3] => stdClass Object
        (
            [rank] => 0
            [ID] => 1704
            [run_id] => 89
            [user] => zholob-i@mail.ru
            [first_name] => Ігор
            [last_name] => Жолоб
            [user_id] => 723
            [date] => 2016-12-31 11:47:21
            [time] => 23:00:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 23:00:00
        )

    [4] => stdClass Object
        (
            [rank] => 0
            [ID] => 2541
            [run_id] => 134
            [user] => ibugryn@ukr.net
            [first_name] => Ігор
            [last_name] => Бугрин
            [user_id] => 965
            [date] => 2017-03-25 23:57:24
            [time] => 23:48:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 23:48:00
        )

    [5] => stdClass Object
        (
            [rank] => 0
            [ID] => 782
            [run_id] => 43
            [user] => valeri_n@icloud.com
            [first_name] => Валерій
            [last_name] => Новіков
            [user_id] => 215
            [date] => 2016-10-01 12:24:56
            [time] => 24:51:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 3
            [personal_best] => 24:51:00
        )

    [6] => stdClass Object
        (
            [rank] => 4
            [ID] => 51
            [run_id] => 8
            [user] => sgusovsky@yahoo.com
            [first_name] => Сергій
            [last_name] => Гусовський
            [user_id] => 80
            [date] => 2016-07-30 07:58:33
            [time] => 25:38:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 25:38:00
        )

    [7] => stdClass Object
        (
            [rank] => 0
            [ID] => 530
            [run_id] => 32
            [user] => babichalex62@gmail.com
            [first_name] => Александр
            [last_name] => Бабич
            [user_id] => 172
            [date] => 2016-09-18 04:20:29
            [time] => 30:55:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 6
            [personal_best] => 30:55:00
        )

    [8] => stdClass Object
        (
            [rank] => 0
            [ID] => 1733
            [run_id] => 89
            [user] => ukraine.sergey@yahoo.com
            [first_name] => SERHII
            [last_name] => KURYLIUK
            [user_id] => 760
            [date] => 2016-12-31 11:47:21
            [time] => 36:33:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 36:33:00
        )

)
Місце Ім’я Час Локація
1 Олександр Бобрицький 20:49:00 Стрийський парк
2 Олександр Волков 21:59:00 Труханів Острів, Київ
3 Віктор Гармаш 22:52:00 Труханів Острів, Київ
4 Ігор Жолоб 23:00:00 Труханів Острів, Київ
5 Ігор Бугрин 23:48:00 Стрийський парк
6 Валерій Новіков 24:51:00 Труханів Острів, Київ
7 Сергій Гусовський 25:38:00 Труханів Острів, Київ
8 Александр Бабич 30:55:00 Труханів Острів, Київ
9 SERHII KURYLIUK 36:33:00 Труханів Острів, Київ

Жінки

SELECT 
		result.event_place as rank, 
		result.ID, 
		run.ID as run_id, 
		user.display_name as user, 
		first_name.meta_value as first_name, 
		last_name.meta_value as last_name, 
		user.ID as user_id, 
		run.date as date, 
		result.time as time, 
		
		location_post.post_title as location_title, 
		location_post.guid as location_link, 
		location_post.ID as location_id,

		club_post.post_title as club_title,
		club_post.guid as club_link,

		volunteer.volunteered as volunteered,
		is_only_volunteered.value as is_only_volunteered,
		result.volunteered as is_volunteered,
		role.title as volunteer_position,

		runner.runs as runs,

		personal_best.value as personal_best

		FROM (SELECT res1.ID, max(res1.run_id) as run_id, res1.user_id, res1.event_place, res1.time, volunteered, volunteer_position
			FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 50
			            AND datediff(now(), meta_value) / 365.25 < 55
					)
				AND user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_sex'
			            AND meta_value = '2'
					)
				) AS res1
			INNER JOIN (
				SELECT user_id, min(time) as time
	            FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 50
			            AND datediff(now(), meta_value) / 365.25 < 55
					)
				AND user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_sex'
			            AND meta_value = '2'
					)
				) AS res3
	            GROUP BY user_id
				) as res2
			ON (res2.user_id = res1.user_id AND res1.time = res2.time)
			GROUP BY user_id
		) as result
		
		LEFT JOIN wp_runday_run as run
		ON result.run_id = run.ID
		
		LEFT JOIN wp_posts as location_post
		ON run.location_id = location_post.ID
		
		LEFT JOIN wp_users as user
		ON result.user_id = user.ID
		
		LEFT JOIN wp_usermeta as first_name
		ON first_name.user_id = user.ID
	    AND first_name.meta_key = 'first_name'
		
		LEFT JOIN wp_usermeta as last_name
		ON last_name.user_id = user.ID
	    AND last_name.meta_key = 'last_name'
		
		LEFT JOIN wp_usermeta as club
		ON club.user_id = user.ID
	    AND club.meta_key = 'club'
		
		LEFT JOIN wp_posts as club_post
		ON club.meta_value = club_post.post_name
		AND club.meta_value != ''
		AND club_post.post_type = 'runday_club'

		LEFT JOIN (
			SELECT user_id, MIN(volunteered) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as is_only_volunteered
		ON is_only_volunteered.user_id = user.ID

		LEFT JOIN (
			SELECT user_id, MIN(time) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as personal_best
		ON personal_best.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, SUM(volunteered) as volunteered
			FROM (
	            SELECT user_id, MAX(volunteered) AS volunteered
				FROM wp_runday_result
				GROUP BY run_id, user_id) as volunteered_per_run
			GROUP BY user_id
			) as volunteer
		ON volunteer.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, count(*) as runs
			FROM (
	            SELECT user_id
				FROM wp_runday_result
				WHERE volunteered = 0) as only_runs
			GROUP BY user_id
			) as runner
		ON runner.user_id = user.ID

		LEFT JOIN wp_runday_volunteer_positions  as role
		ON result.volunteer_position = role.ID

		WHERE 1 = 1
		 ORDER BY  time ASC, volunteered DESCArray
(
)

Вибачте, Результати буде додано після вашого першого забігу

55-59.

Всі

SELECT 
		result.event_place as rank, 
		result.ID, 
		run.ID as run_id, 
		user.display_name as user, 
		first_name.meta_value as first_name, 
		last_name.meta_value as last_name, 
		user.ID as user_id, 
		run.date as date, 
		result.time as time, 
		
		location_post.post_title as location_title, 
		location_post.guid as location_link, 
		location_post.ID as location_id,

		club_post.post_title as club_title,
		club_post.guid as club_link,

		volunteer.volunteered as volunteered,
		is_only_volunteered.value as is_only_volunteered,
		result.volunteered as is_volunteered,
		role.title as volunteer_position,

		runner.runs as runs,

		personal_best.value as personal_best

		FROM (SELECT res1.ID, max(res1.run_id) as run_id, res1.user_id, res1.event_place, res1.time, volunteered, volunteer_position
			FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 55
			            AND datediff(now(), meta_value) / 365.25 < 120
					)
				
				) AS res1
			INNER JOIN (
				SELECT user_id, min(time) as time
	            FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 55
			            AND datediff(now(), meta_value) / 365.25 < 120
					)
				
				) AS res3
	            GROUP BY user_id
				) as res2
			ON (res2.user_id = res1.user_id AND res1.time = res2.time)
			GROUP BY user_id
		) as result
		
		LEFT JOIN wp_runday_run as run
		ON result.run_id = run.ID
		
		LEFT JOIN wp_posts as location_post
		ON run.location_id = location_post.ID
		
		LEFT JOIN wp_users as user
		ON result.user_id = user.ID
		
		LEFT JOIN wp_usermeta as first_name
		ON first_name.user_id = user.ID
	    AND first_name.meta_key = 'first_name'
		
		LEFT JOIN wp_usermeta as last_name
		ON last_name.user_id = user.ID
	    AND last_name.meta_key = 'last_name'
		
		LEFT JOIN wp_usermeta as club
		ON club.user_id = user.ID
	    AND club.meta_key = 'club'
		
		LEFT JOIN wp_posts as club_post
		ON club.meta_value = club_post.post_name
		AND club.meta_value != ''
		AND club_post.post_type = 'runday_club'

		LEFT JOIN (
			SELECT user_id, MIN(volunteered) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as is_only_volunteered
		ON is_only_volunteered.user_id = user.ID

		LEFT JOIN (
			SELECT user_id, MIN(time) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as personal_best
		ON personal_best.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, SUM(volunteered) as volunteered
			FROM (
	            SELECT user_id, MAX(volunteered) AS volunteered
				FROM wp_runday_result
				GROUP BY run_id, user_id) as volunteered_per_run
			GROUP BY user_id
			) as volunteer
		ON volunteer.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, count(*) as runs
			FROM (
	            SELECT user_id
				FROM wp_runday_result
				WHERE volunteered = 0) as only_runs
			GROUP BY user_id
			) as runner
		ON runner.user_id = user.ID

		LEFT JOIN wp_runday_volunteer_positions  as role
		ON result.volunteer_position = role.ID

		WHERE 1 = 1
		 ORDER BY  time ASC, volunteered DESCArray
(
    [0] => stdClass Object
        (
            [rank] => 0
            [ID] => 914
            [run_id] => 47
            [user] => mykola-1961@mail.ua
            [first_name] => Микола
            [last_name] => Кулинич
            [user_id] => 442
            [date] => 2016-10-15 08:02:51
            [time] => 18:23:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 23
            [personal_best] => 18:23:00
        )

    [1] => stdClass Object
        (
            [rank] => 0
            [ID] => 4419
            [run_id] => 245
            [user] => tsikalo@mail.ua
            [first_name] => Юрій
            [last_name] => Цікало
            [user_id] => 674
            [date] => 2017-07-15 15:13:30
            [time] => 19:39:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 16
            [personal_best] => 19:39:00
        )

    [2] => stdClass Object
        (
            [rank] => 0
            [ID] => 1296
            [run_id] => 66
            [user] => kadkalo@carrier.kiev.ua
            [first_name] => Олександр
            [last_name] => Кадькало
            [user_id] => 634
            [date] => 2016-11-19 11:51:36
            [time] => 20:19:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 20:19:00
        )

    [3] => stdClass Object
        (
            [rank] => 0
            [ID] => 393
            [run_id] => 28
            [user] => ivankiv.v@gmail.com
            [first_name] => Володимир
            [last_name] => Іванків
            [user_id] => 294
            [date] => 2016-09-10 13:55:40
            [time] => 22:14:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 22:14:00
        )

    [4] => stdClass Object
        (
            [rank] => 0
            [ID] => 1279
            [run_id] => 65
            [user] => doroty995@gmail.com
            [first_name] => Володимир
            [last_name] => Гольдіс
            [user_id] => 476
            [date] => 2016-11-12 11:09:02
            [time] => 22:33:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 17
            [personal_best] => 22:33:00
        )

    [5] => stdClass Object
        (
            [rank] => 0
            [ID] => 3770
            [run_id] => 201
            [user] => alexander@strongstyle.info
            [first_name] => Александр 
            [last_name] => Сухомлинов
            [user_id] => 802
            [date] => 2017-06-03 18:58:26
            [time] => 24:24:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 5
            [personal_best] => 24:24:00
        )

    [6] => stdClass Object
        (
            [rank] => 0
            [ID] => 3688
            [run_id] => 196
            [user] => mari.kulinich.62@mail.ru
            [first_name] => Марія
            [last_name] => Кулинич
            [user_id] => 544
            [date] => 2017-05-27 19:56:10
            [time] => 26:16:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 19
            [personal_best] => 26:16:00
        )

    [7] => stdClass Object
        (
            [rank] => 0
            [ID] => 1576
            [run_id] => 83
            [user] => z.blyshyn@gmail.com
            [first_name] => Зенон
            [last_name] => Блишин
            [user_id] => 694
            [date] => 2016-12-17 11:04:53
            [time] => 29:13:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 29:13:00
        )

    [8] => stdClass Object
        (
            [rank] => 0
            [ID] => 528
            [run_id] => 32
            [user] => irina@confo.kiev.ua
            [first_name] => Ірина
            [last_name] => Соколовська
            [user_id] => 373
            [date] => 2016-09-18 04:20:29
            [time] => 29:41:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 6
            [personal_best] => 29:41:00
        )

    [9] => stdClass Object
        (
            [rank] => 0
            [ID] => 1163
            [run_id] => 58
            [user] => velotour-lviv1@ukr.net
            [first_name] => Мирослав
            [last_name] => Теслюк
            [user_id] => 600
            [date] => 2016-11-05 09:26:08
            [time] => 33:28:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 33:28:00
        )

    [10] => stdClass Object
        (
            [rank] => 0
            [ID] => 450
            [run_id] => 46
            [user] => n.babich@kubg.edu.ua
            [first_name] => Вера
            [last_name] => Бабич
            [user_id] => 293
            [date] => 2016-10-15 07:53:58
            [time] => 59:59:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 4
            [is_only_volunteered] => 1
            [is_volunteered] => 1
            [volunteer_position] => Tokens
            [runs] => 
            [personal_best] => 59:59:00
        )

    [11] => stdClass Object
        (
            [rank] => 0
            [ID] => 1165
            [run_id] => 59
            [user] => tetiana.sokolnykova@gmail.com
            [first_name] => Тетяна
            [last_name] => Сокольникова
            [user_id] => 612
            [date] => 2016-11-05 09:30:05
            [time] => 59:59:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 1
            [is_volunteered] => 1
            [volunteer_position] => Photographer
            [runs] => 
            [personal_best] => 59:59:00
        )

)
Місце Ім’я Час Локація
1 Микола Кулинич 18:23:00 Стрийський парк
2 Юрій Цікало 19:39:00 Тернопіль: Набережна ставу
3 Олександр Кадькало 20:19:00 Труханів Острів, Київ
4 Володимир Іванків 22:14:00 Стрийський парк
5 Володимир Гольдіс 22:33:00 Стрийський парк
6 Александр Сухомлинов 24:24:00 Труханів Острів, Київ
7 Марія Кулинич 26:16:00 Стрийський парк
8 Зенон Блишин 29:13:00 Тернопіль: Набережна ставу
9 Ірина Соколовська 29:41:00 Труханів Острів, Київ
10 Мирослав Теслюк 33:28:00 Стрийський парк

Чоловіки

SELECT 
		result.event_place as rank, 
		result.ID, 
		run.ID as run_id, 
		user.display_name as user, 
		first_name.meta_value as first_name, 
		last_name.meta_value as last_name, 
		user.ID as user_id, 
		run.date as date, 
		result.time as time, 
		
		location_post.post_title as location_title, 
		location_post.guid as location_link, 
		location_post.ID as location_id,

		club_post.post_title as club_title,
		club_post.guid as club_link,

		volunteer.volunteered as volunteered,
		is_only_volunteered.value as is_only_volunteered,
		result.volunteered as is_volunteered,
		role.title as volunteer_position,

		runner.runs as runs,

		personal_best.value as personal_best

		FROM (SELECT res1.ID, max(res1.run_id) as run_id, res1.user_id, res1.event_place, res1.time, volunteered, volunteer_position
			FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 55
			            AND datediff(now(), meta_value) / 365.25 < 120
					)
				AND user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_sex'
			            AND meta_value = '1'
					)
				) AS res1
			INNER JOIN (
				SELECT user_id, min(time) as time
	            FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 55
			            AND datediff(now(), meta_value) / 365.25 < 120
					)
				AND user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_sex'
			            AND meta_value = '1'
					)
				) AS res3
	            GROUP BY user_id
				) as res2
			ON (res2.user_id = res1.user_id AND res1.time = res2.time)
			GROUP BY user_id
		) as result
		
		LEFT JOIN wp_runday_run as run
		ON result.run_id = run.ID
		
		LEFT JOIN wp_posts as location_post
		ON run.location_id = location_post.ID
		
		LEFT JOIN wp_users as user
		ON result.user_id = user.ID
		
		LEFT JOIN wp_usermeta as first_name
		ON first_name.user_id = user.ID
	    AND first_name.meta_key = 'first_name'
		
		LEFT JOIN wp_usermeta as last_name
		ON last_name.user_id = user.ID
	    AND last_name.meta_key = 'last_name'
		
		LEFT JOIN wp_usermeta as club
		ON club.user_id = user.ID
	    AND club.meta_key = 'club'
		
		LEFT JOIN wp_posts as club_post
		ON club.meta_value = club_post.post_name
		AND club.meta_value != ''
		AND club_post.post_type = 'runday_club'

		LEFT JOIN (
			SELECT user_id, MIN(volunteered) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as is_only_volunteered
		ON is_only_volunteered.user_id = user.ID

		LEFT JOIN (
			SELECT user_id, MIN(time) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as personal_best
		ON personal_best.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, SUM(volunteered) as volunteered
			FROM (
	            SELECT user_id, MAX(volunteered) AS volunteered
				FROM wp_runday_result
				GROUP BY run_id, user_id) as volunteered_per_run
			GROUP BY user_id
			) as volunteer
		ON volunteer.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, count(*) as runs
			FROM (
	            SELECT user_id
				FROM wp_runday_result
				WHERE volunteered = 0) as only_runs
			GROUP BY user_id
			) as runner
		ON runner.user_id = user.ID

		LEFT JOIN wp_runday_volunteer_positions  as role
		ON result.volunteer_position = role.ID

		WHERE 1 = 1
		 ORDER BY  time ASC, volunteered DESCArray
(
    [0] => stdClass Object
        (
            [rank] => 0
            [ID] => 914
            [run_id] => 47
            [user] => mykola-1961@mail.ua
            [first_name] => Микола
            [last_name] => Кулинич
            [user_id] => 442
            [date] => 2016-10-15 08:02:51
            [time] => 18:23:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 23
            [personal_best] => 18:23:00
        )

    [1] => stdClass Object
        (
            [rank] => 0
            [ID] => 4419
            [run_id] => 245
            [user] => tsikalo@mail.ua
            [first_name] => Юрій
            [last_name] => Цікало
            [user_id] => 674
            [date] => 2017-07-15 15:13:30
            [time] => 19:39:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 16
            [personal_best] => 19:39:00
        )

    [2] => stdClass Object
        (
            [rank] => 0
            [ID] => 1296
            [run_id] => 66
            [user] => kadkalo@carrier.kiev.ua
            [first_name] => Олександр
            [last_name] => Кадькало
            [user_id] => 634
            [date] => 2016-11-19 11:51:36
            [time] => 20:19:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 4
            [personal_best] => 20:19:00
        )

    [3] => stdClass Object
        (
            [rank] => 0
            [ID] => 393
            [run_id] => 28
            [user] => ivankiv.v@gmail.com
            [first_name] => Володимир
            [last_name] => Іванків
            [user_id] => 294
            [date] => 2016-09-10 13:55:40
            [time] => 22:14:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 2
            [personal_best] => 22:14:00
        )

    [4] => stdClass Object
        (
            [rank] => 0
            [ID] => 1279
            [run_id] => 65
            [user] => doroty995@gmail.com
            [first_name] => Володимир
            [last_name] => Гольдіс
            [user_id] => 476
            [date] => 2016-11-12 11:09:02
            [time] => 22:33:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 17
            [personal_best] => 22:33:00
        )

    [5] => stdClass Object
        (
            [rank] => 0
            [ID] => 3770
            [run_id] => 201
            [user] => alexander@strongstyle.info
            [first_name] => Александр 
            [last_name] => Сухомлинов
            [user_id] => 802
            [date] => 2017-06-03 18:58:26
            [time] => 24:24:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 5
            [personal_best] => 24:24:00
        )

    [6] => stdClass Object
        (
            [rank] => 0
            [ID] => 1576
            [run_id] => 83
            [user] => z.blyshyn@gmail.com
            [first_name] => Зенон
            [last_name] => Блишин
            [user_id] => 694
            [date] => 2016-12-17 11:04:53
            [time] => 29:13:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 29:13:00
        )

    [7] => stdClass Object
        (
            [rank] => 0
            [ID] => 1163
            [run_id] => 58
            [user] => velotour-lviv1@ukr.net
            [first_name] => Мирослав
            [last_name] => Теслюк
            [user_id] => 600
            [date] => 2016-11-05 09:26:08
            [time] => 33:28:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 33:28:00
        )

)
Місце Ім’я Час Локація
1 Микола Кулинич 18:23:00 Стрийський парк
2 Юрій Цікало 19:39:00 Тернопіль: Набережна ставу
3 Олександр Кадькало 20:19:00 Труханів Острів, Київ
4 Володимир Іванків 22:14:00 Стрийський парк
5 Володимир Гольдіс 22:33:00 Стрийський парк
6 Александр Сухомлинов 24:24:00 Труханів Острів, Київ
7 Зенон Блишин 29:13:00 Тернопіль: Набережна ставу
8 Мирослав Теслюк 33:28:00 Стрийський парк

Жінки

SELECT 
		result.event_place as rank, 
		result.ID, 
		run.ID as run_id, 
		user.display_name as user, 
		first_name.meta_value as first_name, 
		last_name.meta_value as last_name, 
		user.ID as user_id, 
		run.date as date, 
		result.time as time, 
		
		location_post.post_title as location_title, 
		location_post.guid as location_link, 
		location_post.ID as location_id,

		club_post.post_title as club_title,
		club_post.guid as club_link,

		volunteer.volunteered as volunteered,
		is_only_volunteered.value as is_only_volunteered,
		result.volunteered as is_volunteered,
		role.title as volunteer_position,

		runner.runs as runs,

		personal_best.value as personal_best

		FROM (SELECT res1.ID, max(res1.run_id) as run_id, res1.user_id, res1.event_place, res1.time, volunteered, volunteer_position
			FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 55
			            AND datediff(now(), meta_value) / 365.25 < 120
					)
				AND user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_sex'
			            AND meta_value = '2'
					)
				) AS res1
			INNER JOIN (
				SELECT user_id, min(time) as time
	            FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 55
			            AND datediff(now(), meta_value) / 365.25 < 120
					)
				AND user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_sex'
			            AND meta_value = '2'
					)
				) AS res3
	            GROUP BY user_id
				) as res2
			ON (res2.user_id = res1.user_id AND res1.time = res2.time)
			GROUP BY user_id
		) as result
		
		LEFT JOIN wp_runday_run as run
		ON result.run_id = run.ID
		
		LEFT JOIN wp_posts as location_post
		ON run.location_id = location_post.ID
		
		LEFT JOIN wp_users as user
		ON result.user_id = user.ID
		
		LEFT JOIN wp_usermeta as first_name
		ON first_name.user_id = user.ID
	    AND first_name.meta_key = 'first_name'
		
		LEFT JOIN wp_usermeta as last_name
		ON last_name.user_id = user.ID
	    AND last_name.meta_key = 'last_name'
		
		LEFT JOIN wp_usermeta as club
		ON club.user_id = user.ID
	    AND club.meta_key = 'club'
		
		LEFT JOIN wp_posts as club_post
		ON club.meta_value = club_post.post_name
		AND club.meta_value != ''
		AND club_post.post_type = 'runday_club'

		LEFT JOIN (
			SELECT user_id, MIN(volunteered) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as is_only_volunteered
		ON is_only_volunteered.user_id = user.ID

		LEFT JOIN (
			SELECT user_id, MIN(time) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as personal_best
		ON personal_best.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, SUM(volunteered) as volunteered
			FROM (
	            SELECT user_id, MAX(volunteered) AS volunteered
				FROM wp_runday_result
				GROUP BY run_id, user_id) as volunteered_per_run
			GROUP BY user_id
			) as volunteer
		ON volunteer.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, count(*) as runs
			FROM (
	            SELECT user_id
				FROM wp_runday_result
				WHERE volunteered = 0) as only_runs
			GROUP BY user_id
			) as runner
		ON runner.user_id = user.ID

		LEFT JOIN wp_runday_volunteer_positions  as role
		ON result.volunteer_position = role.ID

		WHERE 1 = 1
		 ORDER BY  time ASC, volunteered DESCArray
(
    [0] => stdClass Object
        (
            [rank] => 0
            [ID] => 3688
            [run_id] => 196
            [user] => mari.kulinich.62@mail.ru
            [first_name] => Марія
            [last_name] => Кулинич
            [user_id] => 544
            [date] => 2017-05-27 19:56:10
            [time] => 26:16:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 19
            [personal_best] => 26:16:00
        )

    [1] => stdClass Object
        (
            [rank] => 0
            [ID] => 528
            [run_id] => 32
            [user] => irina@confo.kiev.ua
            [first_name] => Ірина
            [last_name] => Соколовська
            [user_id] => 373
            [date] => 2016-09-18 04:20:29
            [time] => 29:41:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 6
            [personal_best] => 29:41:00
        )

    [2] => stdClass Object
        (
            [rank] => 0
            [ID] => 450
            [run_id] => 46
            [user] => n.babich@kubg.edu.ua
            [first_name] => Вера
            [last_name] => Бабич
            [user_id] => 293
            [date] => 2016-10-15 07:53:58
            [time] => 59:59:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 4
            [is_only_volunteered] => 1
            [is_volunteered] => 1
            [volunteer_position] => Tokens
            [runs] => 
            [personal_best] => 59:59:00
        )

    [3] => stdClass Object
        (
            [rank] => 0
            [ID] => 1165
            [run_id] => 59
            [user] => tetiana.sokolnykova@gmail.com
            [first_name] => Тетяна
            [last_name] => Сокольникова
            [user_id] => 612
            [date] => 2016-11-05 09:30:05
            [time] => 59:59:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 1
            [is_volunteered] => 1
            [volunteer_position] => Photographer
            [runs] => 
            [personal_best] => 59:59:00
        )

)
Місце Ім’я Час Локація
1 Марія Кулинич 26:16:00 Стрийський парк
2 Ірина Соколовська 29:41:00 Труханів Острів, Київ

60-70.

Всі

SELECT 
		result.event_place as rank, 
		result.ID, 
		run.ID as run_id, 
		user.display_name as user, 
		first_name.meta_value as first_name, 
		last_name.meta_value as last_name, 
		user.ID as user_id, 
		run.date as date, 
		result.time as time, 
		
		location_post.post_title as location_title, 
		location_post.guid as location_link, 
		location_post.ID as location_id,

		club_post.post_title as club_title,
		club_post.guid as club_link,

		volunteer.volunteered as volunteered,
		is_only_volunteered.value as is_only_volunteered,
		result.volunteered as is_volunteered,
		role.title as volunteer_position,

		runner.runs as runs,

		personal_best.value as personal_best

		FROM (SELECT res1.ID, max(res1.run_id) as run_id, res1.user_id, res1.event_place, res1.time, volunteered, volunteer_position
			FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 60
			            AND datediff(now(), meta_value) / 365.25 < 70
					)
				
				) AS res1
			INNER JOIN (
				SELECT user_id, min(time) as time
	            FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 60
			            AND datediff(now(), meta_value) / 365.25 < 70
					)
				
				) AS res3
	            GROUP BY user_id
				) as res2
			ON (res2.user_id = res1.user_id AND res1.time = res2.time)
			GROUP BY user_id
		) as result
		
		LEFT JOIN wp_runday_run as run
		ON result.run_id = run.ID
		
		LEFT JOIN wp_posts as location_post
		ON run.location_id = location_post.ID
		
		LEFT JOIN wp_users as user
		ON result.user_id = user.ID
		
		LEFT JOIN wp_usermeta as first_name
		ON first_name.user_id = user.ID
	    AND first_name.meta_key = 'first_name'
		
		LEFT JOIN wp_usermeta as last_name
		ON last_name.user_id = user.ID
	    AND last_name.meta_key = 'last_name'
		
		LEFT JOIN wp_usermeta as club
		ON club.user_id = user.ID
	    AND club.meta_key = 'club'
		
		LEFT JOIN wp_posts as club_post
		ON club.meta_value = club_post.post_name
		AND club.meta_value != ''
		AND club_post.post_type = 'runday_club'

		LEFT JOIN (
			SELECT user_id, MIN(volunteered) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as is_only_volunteered
		ON is_only_volunteered.user_id = user.ID

		LEFT JOIN (
			SELECT user_id, MIN(time) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as personal_best
		ON personal_best.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, SUM(volunteered) as volunteered
			FROM (
	            SELECT user_id, MAX(volunteered) AS volunteered
				FROM wp_runday_result
				GROUP BY run_id, user_id) as volunteered_per_run
			GROUP BY user_id
			) as volunteer
		ON volunteer.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, count(*) as runs
			FROM (
	            SELECT user_id
				FROM wp_runday_result
				WHERE volunteered = 0) as only_runs
			GROUP BY user_id
			) as runner
		ON runner.user_id = user.ID

		LEFT JOIN wp_runday_volunteer_positions  as role
		ON result.volunteer_position = role.ID

		WHERE 1 = 1
		 ORDER BY  time ASC, volunteered DESCArray
(
    [0] => stdClass Object
        (
            [rank] => 0
            [ID] => 4419
            [run_id] => 245
            [user] => tsikalo@mail.ua
            [first_name] => Юрій
            [last_name] => Цікало
            [user_id] => 674
            [date] => 2017-07-15 15:13:30
            [time] => 19:39:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 16
            [personal_best] => 19:39:00
        )

    [1] => stdClass Object
        (
            [rank] => 0
            [ID] => 3770
            [run_id] => 201
            [user] => alexander@strongstyle.info
            [first_name] => Александр 
            [last_name] => Сухомлинов
            [user_id] => 802
            [date] => 2017-06-03 18:58:26
            [time] => 24:24:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 5
            [personal_best] => 24:24:00
        )

    [2] => stdClass Object
        (
            [rank] => 0
            [ID] => 1576
            [run_id] => 83
            [user] => z.blyshyn@gmail.com
            [first_name] => Зенон
            [last_name] => Блишин
            [user_id] => 694
            [date] => 2016-12-17 11:04:53
            [time] => 29:13:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 29:13:00
        )

    [3] => stdClass Object
        (
            [rank] => 0
            [ID] => 528
            [run_id] => 32
            [user] => irina@confo.kiev.ua
            [first_name] => Ірина
            [last_name] => Соколовська
            [user_id] => 373
            [date] => 2016-09-18 04:20:29
            [time] => 29:41:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 6
            [personal_best] => 29:41:00
        )

    [4] => stdClass Object
        (
            [rank] => 0
            [ID] => 1163
            [run_id] => 58
            [user] => velotour-lviv1@ukr.net
            [first_name] => Мирослав
            [last_name] => Теслюк
            [user_id] => 600
            [date] => 2016-11-05 09:26:08
            [time] => 33:28:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 33:28:00
        )

    [5] => stdClass Object
        (
            [rank] => 0
            [ID] => 1165
            [run_id] => 59
            [user] => tetiana.sokolnykova@gmail.com
            [first_name] => Тетяна
            [last_name] => Сокольникова
            [user_id] => 612
            [date] => 2016-11-05 09:30:05
            [time] => 59:59:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 1
            [is_volunteered] => 1
            [volunteer_position] => Photographer
            [runs] => 
            [personal_best] => 59:59:00
        )

)
Місце Ім’я Час Локація
1 Юрій Цікало 19:39:00 Тернопіль: Набережна ставу
2 Александр Сухомлинов 24:24:00 Труханів Острів, Київ
3 Зенон Блишин 29:13:00 Тернопіль: Набережна ставу
4 Ірина Соколовська 29:41:00 Труханів Острів, Київ
5 Мирослав Теслюк 33:28:00 Стрийський парк

Чоловіки

SELECT 
		result.event_place as rank, 
		result.ID, 
		run.ID as run_id, 
		user.display_name as user, 
		first_name.meta_value as first_name, 
		last_name.meta_value as last_name, 
		user.ID as user_id, 
		run.date as date, 
		result.time as time, 
		
		location_post.post_title as location_title, 
		location_post.guid as location_link, 
		location_post.ID as location_id,

		club_post.post_title as club_title,
		club_post.guid as club_link,

		volunteer.volunteered as volunteered,
		is_only_volunteered.value as is_only_volunteered,
		result.volunteered as is_volunteered,
		role.title as volunteer_position,

		runner.runs as runs,

		personal_best.value as personal_best

		FROM (SELECT res1.ID, max(res1.run_id) as run_id, res1.user_id, res1.event_place, res1.time, volunteered, volunteer_position
			FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 60
			            AND datediff(now(), meta_value) / 365.25 < 70
					)
				AND user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_sex'
			            AND meta_value = '1'
					)
				) AS res1
			INNER JOIN (
				SELECT user_id, min(time) as time
	            FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 60
			            AND datediff(now(), meta_value) / 365.25 < 70
					)
				AND user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_sex'
			            AND meta_value = '1'
					)
				) AS res3
	            GROUP BY user_id
				) as res2
			ON (res2.user_id = res1.user_id AND res1.time = res2.time)
			GROUP BY user_id
		) as result
		
		LEFT JOIN wp_runday_run as run
		ON result.run_id = run.ID
		
		LEFT JOIN wp_posts as location_post
		ON run.location_id = location_post.ID
		
		LEFT JOIN wp_users as user
		ON result.user_id = user.ID
		
		LEFT JOIN wp_usermeta as first_name
		ON first_name.user_id = user.ID
	    AND first_name.meta_key = 'first_name'
		
		LEFT JOIN wp_usermeta as last_name
		ON last_name.user_id = user.ID
	    AND last_name.meta_key = 'last_name'
		
		LEFT JOIN wp_usermeta as club
		ON club.user_id = user.ID
	    AND club.meta_key = 'club'
		
		LEFT JOIN wp_posts as club_post
		ON club.meta_value = club_post.post_name
		AND club.meta_value != ''
		AND club_post.post_type = 'runday_club'

		LEFT JOIN (
			SELECT user_id, MIN(volunteered) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as is_only_volunteered
		ON is_only_volunteered.user_id = user.ID

		LEFT JOIN (
			SELECT user_id, MIN(time) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as personal_best
		ON personal_best.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, SUM(volunteered) as volunteered
			FROM (
	            SELECT user_id, MAX(volunteered) AS volunteered
				FROM wp_runday_result
				GROUP BY run_id, user_id) as volunteered_per_run
			GROUP BY user_id
			) as volunteer
		ON volunteer.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, count(*) as runs
			FROM (
	            SELECT user_id
				FROM wp_runday_result
				WHERE volunteered = 0) as only_runs
			GROUP BY user_id
			) as runner
		ON runner.user_id = user.ID

		LEFT JOIN wp_runday_volunteer_positions  as role
		ON result.volunteer_position = role.ID

		WHERE 1 = 1
		 ORDER BY  time ASC, volunteered DESCArray
(
    [0] => stdClass Object
        (
            [rank] => 0
            [ID] => 4419
            [run_id] => 245
            [user] => tsikalo@mail.ua
            [first_name] => Юрій
            [last_name] => Цікало
            [user_id] => 674
            [date] => 2017-07-15 15:13:30
            [time] => 19:39:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 16
            [personal_best] => 19:39:00
        )

    [1] => stdClass Object
        (
            [rank] => 0
            [ID] => 3770
            [run_id] => 201
            [user] => alexander@strongstyle.info
            [first_name] => Александр 
            [last_name] => Сухомлинов
            [user_id] => 802
            [date] => 2017-06-03 18:58:26
            [time] => 24:24:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 5
            [personal_best] => 24:24:00
        )

    [2] => stdClass Object
        (
            [rank] => 0
            [ID] => 1576
            [run_id] => 83
            [user] => z.blyshyn@gmail.com
            [first_name] => Зенон
            [last_name] => Блишин
            [user_id] => 694
            [date] => 2016-12-17 11:04:53
            [time] => 29:13:00
            [location_title] => Тернопіль: Набережна ставу
            [location_link] => https://runday.org/?post_type=runday_location&p=24988
            [location_id] => 24988
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 29:13:00
        )

    [3] => stdClass Object
        (
            [rank] => 0
            [ID] => 1163
            [run_id] => 58
            [user] => velotour-lviv1@ukr.net
            [first_name] => Мирослав
            [last_name] => Теслюк
            [user_id] => 600
            [date] => 2016-11-05 09:26:08
            [time] => 33:28:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 1
            [personal_best] => 33:28:00
        )

)
Місце Ім’я Час Локація
1 Юрій Цікало 19:39:00 Тернопіль: Набережна ставу
2 Александр Сухомлинов 24:24:00 Труханів Острів, Київ
3 Зенон Блишин 29:13:00 Тернопіль: Набережна ставу
4 Мирослав Теслюк 33:28:00 Стрийський парк

Жінки

SELECT 
		result.event_place as rank, 
		result.ID, 
		run.ID as run_id, 
		user.display_name as user, 
		first_name.meta_value as first_name, 
		last_name.meta_value as last_name, 
		user.ID as user_id, 
		run.date as date, 
		result.time as time, 
		
		location_post.post_title as location_title, 
		location_post.guid as location_link, 
		location_post.ID as location_id,

		club_post.post_title as club_title,
		club_post.guid as club_link,

		volunteer.volunteered as volunteered,
		is_only_volunteered.value as is_only_volunteered,
		result.volunteered as is_volunteered,
		role.title as volunteer_position,

		runner.runs as runs,

		personal_best.value as personal_best

		FROM (SELECT res1.ID, max(res1.run_id) as run_id, res1.user_id, res1.event_place, res1.time, volunteered, volunteer_position
			FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 55
			            AND datediff(now(), meta_value) / 365.25 < 70
					)
				AND user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_sex'
			            AND meta_value = '2'
					)
				) AS res1
			INNER JOIN (
				SELECT user_id, min(time) as time
	            FROM (SELECT * 
					FROM wp_runday_result
					WHERE user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_age'
			            AND datediff(now(), meta_value) / 365.25 >= 55
			            AND datediff(now(), meta_value) / 365.25 < 70
					)
				AND user_id
					IN (
						SELECT user_id 
			            FROM wp_usermeta
			            WHERE meta_key = 'user_sex'
			            AND meta_value = '2'
					)
				) AS res3
	            GROUP BY user_id
				) as res2
			ON (res2.user_id = res1.user_id AND res1.time = res2.time)
			GROUP BY user_id
		) as result
		
		LEFT JOIN wp_runday_run as run
		ON result.run_id = run.ID
		
		LEFT JOIN wp_posts as location_post
		ON run.location_id = location_post.ID
		
		LEFT JOIN wp_users as user
		ON result.user_id = user.ID
		
		LEFT JOIN wp_usermeta as first_name
		ON first_name.user_id = user.ID
	    AND first_name.meta_key = 'first_name'
		
		LEFT JOIN wp_usermeta as last_name
		ON last_name.user_id = user.ID
	    AND last_name.meta_key = 'last_name'
		
		LEFT JOIN wp_usermeta as club
		ON club.user_id = user.ID
	    AND club.meta_key = 'club'
		
		LEFT JOIN wp_posts as club_post
		ON club.meta_value = club_post.post_name
		AND club.meta_value != ''
		AND club_post.post_type = 'runday_club'

		LEFT JOIN (
			SELECT user_id, MIN(volunteered) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as is_only_volunteered
		ON is_only_volunteered.user_id = user.ID

		LEFT JOIN (
			SELECT user_id, MIN(time) as value
			FROM wp_runday_result
			GROUP BY user_id
			) as personal_best
		ON personal_best.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, SUM(volunteered) as volunteered
			FROM (
	            SELECT user_id, MAX(volunteered) AS volunteered
				FROM wp_runday_result
				GROUP BY run_id, user_id) as volunteered_per_run
			GROUP BY user_id
			) as volunteer
		ON volunteer.user_id = user.ID
		
		LEFT JOIN (
			SELECT user_id, count(*) as runs
			FROM (
	            SELECT user_id
				FROM wp_runday_result
				WHERE volunteered = 0) as only_runs
			GROUP BY user_id
			) as runner
		ON runner.user_id = user.ID

		LEFT JOIN wp_runday_volunteer_positions  as role
		ON result.volunteer_position = role.ID

		WHERE 1 = 1
		 ORDER BY  time ASC, volunteered DESCArray
(
    [0] => stdClass Object
        (
            [rank] => 0
            [ID] => 3688
            [run_id] => 196
            [user] => mari.kulinich.62@mail.ru
            [first_name] => Марія
            [last_name] => Кулинич
            [user_id] => 544
            [date] => 2017-05-27 19:56:10
            [time] => 26:16:00
            [location_title] => Стрийський парк
            [location_link] => http://runday.org/?post_type=runday_location&p=983
            [location_id] => 983
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 19
            [personal_best] => 26:16:00
        )

    [1] => stdClass Object
        (
            [rank] => 0
            [ID] => 528
            [run_id] => 32
            [user] => irina@confo.kiev.ua
            [first_name] => Ірина
            [last_name] => Соколовська
            [user_id] => 373
            [date] => 2016-09-18 04:20:29
            [time] => 29:41:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 0
            [is_only_volunteered] => 0
            [is_volunteered] => 0
            [volunteer_position] => 
            [runs] => 6
            [personal_best] => 29:41:00
        )

    [2] => stdClass Object
        (
            [rank] => 0
            [ID] => 450
            [run_id] => 46
            [user] => n.babich@kubg.edu.ua
            [first_name] => Вера
            [last_name] => Бабич
            [user_id] => 293
            [date] => 2016-10-15 07:53:58
            [time] => 59:59:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 4
            [is_only_volunteered] => 1
            [is_volunteered] => 1
            [volunteer_position] => Tokens
            [runs] => 
            [personal_best] => 59:59:00
        )

    [3] => stdClass Object
        (
            [rank] => 0
            [ID] => 1165
            [run_id] => 59
            [user] => tetiana.sokolnykova@gmail.com
            [first_name] => Тетяна
            [last_name] => Сокольникова
            [user_id] => 612
            [date] => 2016-11-05 09:30:05
            [time] => 59:59:00
            [location_title] => Труханів Острів, Київ
            [location_link] => http://runday.org/?post_type=runday_location&p=314
            [location_id] => 314
            [club_title] => 
            [club_link] => 
            [volunteered] => 1
            [is_only_volunteered] => 1
            [is_volunteered] => 1
            [volunteer_position] => Photographer
            [runs] => 
            [personal_best] => 59:59:00
        )

)
Місце Ім’я Час Локація
1 Марія Кулинич 26:16:00 Стрийський парк
2 Ірина Соколовська 29:41:00 Труханів Острів, Київ