SELECT lc_use_debate FROM `Learning_Online_Course` loc
LEFT JOIN Learning_Course lc ON (loc.loc_no = lc.loc_no)
WHERE loc.loc_no = ORDER BY lc_no DESC LIMIT 1 Sql Error - 001 : 1064 : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY lc_no DESC LIMIT 1' at line 3