SELECT
DISTINCT `race_mrp_id` as `race`, race_date, track_name, race_series, race_start, race_finish, race_laps_completed, race_laps_led, race_money_won, race_points, race_mrp_id, race_driver_car_number, race_dns, race_dnf, race_dq,
(SELECT ifnull((SELECT (race_points) from woo_a_main WHERE race_driver_id = '2060' AND race_mrp_id = `race`), 0) +
ifnull((SELECT (race_points) from woo_b_main WHERE race_driver_id = '2060' AND race_mrp_id = `race`), 0) +
ifnull((SELECT (race_points) from woo_b_main_2 WHERE race_driver_id = '2060' AND race_mrp_id = `race`), 0) +
ifnull((SELECT (race_points) from woo_b_main_3 WHERE race_driver_id = '2060' AND race_mrp_id = `race`), 0)) as `Total_Points`
FROM woo_a_main LEFT JOIN `woo_tracks` ON woo_a_main.`race_track` = woo_tracks.`track_mrp_id`
WHERE `race_driver_id` = '2060' AND `race_date` REGEXP '2022' AND race_series REGEXP 'World of Outlaws Sprint Cars'
UNION ALL
SELECT DISTINCT `race_mrp_id` as `race`, race_date, track_name, race_series, concat('B', race_start), concat('B', `race_finish`), race_laps_completed, race_laps_led, race_money_won, race_points, race_mrp_id, race_driver_car_number, race_dns, race_dnf, race_dq,
(SELECT ifnull((SELECT (race_points) from woo_a_main WHERE race_driver_id = '2060' AND race_mrp_id = `race`), 0) +
ifnull((SELECT (race_points) from woo_b_main WHERE race_driver_id = '2060' AND race_mrp_id = `race`), 0) +
ifnull((SELECT (race_points) from woo_b_main_2 WHERE race_driver_id = '2060' AND race_mrp_id = `race`), 0) +
ifnull((SELECT (race_points) from woo_b_main_3 WHERE race_driver_id = '2060' AND race_mrp_id = `race`), 0)) as `Total_Points`
FROM woo_b_main LEFT JOIN `woo_tracks` ON woo_b_main.`race_track` = woo_tracks.`track_mrp_id`
WHERE race_driver_id = '2060' AND race_points != '0' AND `race_date` REGEXP '2022' AND race_series REGEXP 'World of Outlaws Sprint Cars'
UNION ALL
SELECT DISTINCT `race_mrp_id` as `race`, race_date, track_name, race_series, concat('B', race_start), concat('B', `race_finish`), race_laps_completed, race_laps_led, race_money_won, race_points, race_mrp_id, race_driver_car_number, race_dns, race_dnf, race_dq,
(SELECT ifnull((SELECT (race_points) from woo_a_main WHERE race_driver_id = '2060' AND race_mrp_id = `race`), 0) +
ifnull((SELECT (race_points) from woo_b_main WHERE race_driver_id = '2060' AND race_mrp_id = `race`), 0) +
ifnull((SELECT (race_points) from woo_b_main_2 WHERE race_driver_id = '2060' AND race_mrp_id = `race`), 0) +
ifnull((SELECT (race_points) from woo_b_main_3 WHERE race_driver_id = '2060' AND race_mrp_id = `race`), 0)) as `Total_Points`
FROM woo_b_main_2 LEFT JOIN `woo_tracks` ON woo_b_main_2.`race_track` = woo_tracks.`track_mrp_id`
WHERE race_driver_id = '2060' AND race_points != '0' AND `race_date` REGEXP '2022' AND race_series REGEXP 'World of Outlaws Sprint Cars'
UNION ALL
SELECT DISTINCT `race_mrp_id` as `race`, race_date, track_name, race_series, concat('B', race_start), concat('B', `race_finish`), race_laps_completed, race_laps_led, race_money_won, race_points, race_mrp_id, race_driver_car_number, race_dns, race_dnf, race_dq,
(SELECT ifnull((SELECT (race_points) from woo_a_main WHERE race_driver_id = '2060' AND race_mrp_id = `race`), 0) +
ifnull((SELECT (race_points) from woo_b_main WHERE race_driver_id = '2060' AND race_mrp_id = `race`), 0) +
ifnull((SELECT (race_points) from woo_b_main_2 WHERE race_driver_id = '2060' AND race_mrp_id = `race`), 0) +
ifnull((SELECT (race_points) from woo_b_main_3 WHERE race_driver_id = '2060' AND race_mrp_id = `race`), 0)) as `Total_Points`
FROM woo_b_main_3 LEFT JOIN `woo_tracks` ON woo_b_main_3.`race_track` = woo_tracks.`track_mrp_id`
WHERE race_driver_id = '2060' AND race_points != '0' AND `race_date` REGEXP '2022' AND race_series REGEXP 'World of Outlaws Sprint Cars' ORDER BY race_date ASC06/25/22 | Huset's Speedway | World of Outlaws Sprint Cars | 0 | B16 | B16 | 2K | 14 | 0 | Running | $300 | 90 |
08/05/22 | Federated Auto Parts I-55 Raceway | World of Outlaws Sprint Cars | 39 | B19 | B19 | 2K | 2 | 0 | Running | $200 | 90 |
08/06/22 | Federated Auto Parts I-55 Raceway | World of Outlaws Sprint Cars | 38 | B13 | B9 | 2K | 12 | 0 | Running | $200 | 90 |
08/19/22 | Jackson Motorplex | World of Outlaws Sprint Cars | 40 | B16 | B15 | 2K | 3 | 0 | Running | $200 | 90 |
08/20/22 | Jackson Motorplex | World of Outlaws Sprint Cars | 38 | B13 | B14 | 2K | 11 | 0 | Running | $300 | 90 |
08/27/22 | Red River Valley Speedway | World of Outlaws Sprint Cars | 29 | 24 | 19 | 2K | 11 | 0 | Running | $1,000 | 112 |
10/14/22 | I-80 Speedway | World of Outlaws Sprint Cars | 39 | B19 | B11 | 2K | 12 | 0 | Running | $200 | 90 |
10/15/22 | Lakeside Speedway | World of Outlaws Sprint Cars | 37 | B17 | B17 | 2K | 0 | 0 | DNF | $200 | 90 |
| Feature Stats | | | 24.0 | 19.0 | | 11 | 0 | | $1,000 | 742 |