Core/Database: Fix bad sql query in 55b3819d12699ee5d255b8dea82ab6aaee093a07 (thx Shauren)