SelectWithUnionQuery (children 1)
 ExpressionList (children 1)
  SelectQuery (children 4)
   ExpressionList (children 1)
    WithElement (children 1)
     Subquery (children 1)
      SelectWithUnionQuery (children 1)
       ExpressionList (children 2)
        SelectQuery (children 1)
         ExpressionList (children 2)
          Function groupUniqArrayState (alias dates_seen) (children 1)
           ExpressionList (children 1)
            Function toDate (children 1)
             ExpressionList (children 1)
              Literal \'2025-01-01 01:00:00\'
          Function toDateTime (alias last_seen) (children 1)
           ExpressionList (children 1)
            Literal \'2025-01-01 01:00:00\'
        SelectQuery (children 1)
         ExpressionList (children 2)
          Function groupUniqArrayState (alias dates_seen) (children 1)
           ExpressionList (children 1)
            Function toDate (children 1)
             ExpressionList (children 1)
              Literal \'2023-11-11 11:11:11\'
          Function toDateTime (alias last_seen) (children 1)
           ExpressionList (children 1)
            Literal \'2023-11-11 11:11:11\'
   ExpressionList (children 1)
    Identifier last_seen
   TablesInSelectQuery (children 1)
    TablesInSelectQueryElement (children 1)
     TableExpression (children 1)
      TableIdentifier activity
   Function less (children 1)
    ExpressionList (children 2)
     Identifier last_seen
     Function toDateTime (children 1)
      ExpressionList (children 1)
       Literal \'2020-01-01 00:00:00\'
