> Make sure to check documentation https://clickhouse.com/docs/en/ first. If the question is concise and probably has a short answer, asking it in Telegram chat https://telegram.me/clickhouse_en is probably the fastest way to find the answer. For more complicated questions, consider asking them on StackOverflow with "clickhouse" tag https://stackoverflow.com/questions/tagged/clickhouse 

> If you still prefer GitHub issues, remove all this text and ask your question here.

sql【1】:  
`select count()
from (
         SELECT event_dt
         FROM (select event_dt, 403 AS event_id
               from (
                        select event_dt
                        from tba as tba
                        where event_id = 9
                          and ((tba.event_dt >= 20220822 and tba.event_dt <= 20220822))
                        )) tba
         WHERE tba.event_dt >= 20220822
           and tba.event_dt <= 20220822
         );`

sql【2】:
`select count()
from (
         SELECT event_dt
         FROM (select event_dt, 403 AS event_id
               from (
                        select event_dt
                        from tba as tba
                        where event_id = 9
                          and ((tba.event_dt >= 20220822 and tba.event_dt <= 20220822))
                        )) tba
         WHERE tba.event_dt >= 20220822
           and tba.event_dt <= 20220822
           and event_id = 403
         );`

why sql【2】result less data
if (func && inverse_relations.find(func->name) != inverse_relations.cend())
    {
        if (need_inversion)
        {
            cloned_node->as<ASTFunction>()->name = inverse_relations.at(func->name);
        }
        return cloned_node;
    }
    return need_inversion ? makeASTFunction("not", cloned_node) : cloned_node;
}
static const ActionsDAG::Node & cloneASTWithInversionPushDown(
    const ActionsDAG::Node & node,
    ActionsDAG & inverted_dag,
    std::unordered_map<const ActionsDAG::Node *, const ActionsDAG::Node *> to_inverted,
    const ContextPtr & context,
    const bool need_inversion)
{
    {
        auto it = to_inverted.find(&node);
        if (it != to_inverted.end())
            return *it->second;
    }
    const ActionsDAG::Node * res = nullptr;
    switch (node.type)
    {
        case (ActionsDAG::ActionType::INPUT):
        {
            
            res = &inverted_dag.addInput({node.column, node.result_type, node.result_name});
            break;