You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') AND race1_tb.nascar_fin > 0 AND (race1_tb.drv_id = driver_tb.drv_id) AND (tr' at line 1