SQL: small fix for cases like "select"