SelectWithUnionQuery (children 1)
 ExpressionList (children 1)
  SelectQuery (children 3)
   ExpressionList (children 2)
    Subquery (alias withA) (children 1)
     SelectWithUnionQuery (children 1)
      ExpressionList (children 1)
       SelectQuery (children 2)
        ExpressionList (children 1)
         Function countDistinct (children 1)
          ExpressionList (children 1)
           Identifier colU
        TablesInSelectQuery (children 1)
         TablesInSelectQueryElement (children 1)
          TableExpression (children 1)
           TableIdentifier tabA
    Subquery (alias withB) (children 1)
     SelectWithUnionQuery (children 1)
      ExpressionList (children 1)
       SelectQuery (children 2)
        ExpressionList (children 1)
         Function countDistinct (children 1)
          ExpressionList (children 1)
           Identifier colU
        TablesInSelectQuery (children 1)
         TablesInSelectQueryElement (children 1)
          TableExpression (children 1)
           TableIdentifier tabA
   ExpressionList (children 1)
    Function divide (alias ratio) (children 1)
     ExpressionList (children 2)
      Identifier withA
      Identifier withB
   TablesInSelectQuery (children 1)
    TablesInSelectQueryElement (children 1)
     TableExpression (children 1)
      Subquery (alias main) (children 1)
       SelectWithUnionQuery (children 1)
        ExpressionList (children 1)
         SelectQuery (children 3)
          ExpressionList (children 2)
           Identifier date (alias period)
           Identifier colX
          TablesInSelectQuery (children 1)
           TablesInSelectQueryElement (children 1)
            TableExpression (children 1)
             Subquery (alias tempB) (children 1)
              SelectWithUnionQuery (children 1)
               ExpressionList (children 1)
                SelectQuery (children 2)
                 ExpressionList (children 2)
                  Identifier date
                  Function if (alias colX) (children 1)
                   ExpressionList (children 3)
                    Function in (children 1)
                     ExpressionList (children 2)
                      Identifier colA
                      Subquery (children 1)
                       SelectWithUnionQuery (children 1)
                        ExpressionList (children 1)
                         SelectQuery (children 2)
                          ExpressionList (children 1)
                           Identifier colB
                          TablesInSelectQuery (children 1)
                           TablesInSelectQueryElement (children 1)
                            TableExpression (children 1)
                             TableIdentifier tabC
                    Literal UInt64_0
                    Identifier colA
                 TablesInSelectQuery (children 1)
                  TablesInSelectQueryElement (children 1)
                   TableExpression (children 1)
                    TableIdentifier tabB
          ExpressionList (children 2)
           Identifier period
           Identifier colX
