Fix column name in SQL query