MySQL Fatal Error
MySQL Error!
MySQL error in file: /functions.php at line 34
Error Number: 1064
The Error returned was:
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 'all = 1 ORDER BY loan_data.sum_total ASC LIMIT 18446744073709551615 ) AS a GROUP' at line 1
SQL query:

SELECT * FROM( SELECT creditors.*, loan_data.sum_get, loan_data.sum_month, loan_data.sum_total, loan_data.sum_over, loan_data.sum_over_p, loan_data.term, loan_data.bvkkmn, loan_data.mpn, loan_data.admin_fee FROM `creditors` LEFT JOIN loan_data ON creditors.id = loan_data.creditor_id WHERE all = 1 ORDER BY loan_data.sum_total ASC LIMIT 18446744073709551615 ) AS a GROUP BY a.seo ORDER BY a.sum_total