Fix the suggestions SQL query

Now it works on every SQLite versions.