My query should  return data  ,but  the result is sql; What should I do?
Read the documentation. Follow the quickstart. Try iterating over your `query`.

Post questions on stackoverflow. @wbzdssm When I use `scalar` it returns data.

What is `FunctionName`, is that a table?

Please add a reproducible example. > FunctionName

yes , it' a table;  @wbzdssm Can you add a reproducible example?

You can use the sqllite's in memory for convenience.

```


from peewee import *

db = SqliteDatabase(':memory:')

class BaseModel(Model):
    class Meta:
        database = db


class FunctionName(BaseModel):
    name = TextField()


db.create_tables([FunctionName])

function_name = FunctionName.create(name='foo')

query = FunctionName.select(
    fn.MAX(FunctionName.name)
).where(
    FunctionName.id == function_name.id
).group_by(
    FunctionName.id
).scalar(as_tuple=True)

print(query)
```

This will output `('foo',)` as expected. tks
My query should  return data  ,but  the result is sql; What should I do?

sql just like:



    query =  FunctionName.select(
            *query_fileds
        ).where(
            *cond
        ).group_by(
            FunctionName.appid
        ).scalar(as_tuple=True)


