SelectWithUnionQuery (children 1)
 ExpressionList (children 1)
  SelectQuery (children 3)
   ExpressionList (children 1)
    Identifier domain
   TablesInSelectQuery (children 2)
    TablesInSelectQueryElement (children 1)
     TableExpression (children 1)
      Subquery (alias js1) (children 1)
       SelectWithUnionQuery (children 1)
        ExpressionList (children 1)
         SelectQuery (children 5)
          ExpressionList (children 2)
           Function sum (alias total) (children 1)
            ExpressionList (children 1)
             Identifier total_count
           Identifier domain
          TablesInSelectQuery (children 1)
           TablesInSelectQueryElement (children 1)
            TableExpression (children 1)
             Subquery (children 1)
              SelectWithUnionQuery (children 1)
               ExpressionList (children 2)
                SelectQuery (children 3)
                 ExpressionList (children 3)
                  Function COUNT (alias total_count) (children 1)
                   ExpressionList (children 1)
                    Asterisk
                  Function toUInt64 (alias facebookHits) (children 1)
                   ExpressionList (children 1)
                    Literal UInt64_0
                  Identifier domain
                 TablesInSelectQuery (children 1)
                  TablesInSelectQueryElement (children 1)
                   TableExpression (children 1)
                    TableIdentifier transactions
                 ExpressionList (children 1)
                  Identifier domain
                SelectQuery (children 3)
                 ExpressionList (children 3)
                  Function COUNT (alias total_count) (children 1)
                   ExpressionList (children 1)
                    Asterisk
                  Function SUM (alias facebookHits) (children 1)
                   ExpressionList (children 1)
                    Function if (children 1)
                     ExpressionList (children 3)
                      Function equals (children 1)
                       ExpressionList (children 2)
                        Identifier domain
                        Literal \'facebook.com\'
                      Literal UInt64_1
                      Literal UInt64_0
                  Identifier domain
                 TablesInSelectQuery (children 1)
                  TablesInSelectQueryElement (children 1)
                   TableExpression (children 1)
                    TableIdentifier clicks
                 ExpressionList (children 1)
                  Identifier domain
          ExpressionList (children 1)
           Identifier domain
          ExpressionList (children 1)
           OrderByElement (children 1)
            Identifier domain
          Literal UInt64_10
    TablesInSelectQueryElement (children 2)
     TableExpression (children 1)
      Subquery (alias js2) (children 1)
       SelectWithUnionQuery (children 1)
        ExpressionList (children 1)
         SelectQuery (children 5)
          ExpressionList (children 2)
           Function sum (alias total) (children 1)
            ExpressionList (children 1)
             Identifier total_count
           Identifier domain
          TablesInSelectQuery (children 1)
           TablesInSelectQueryElement (children 1)
            TableExpression (children 1)
             Subquery (children 1)
              SelectWithUnionQuery (children 1)
               ExpressionList (children 2)
                SelectQuery (children 3)
                 ExpressionList (children 3)
                  Function COUNT (alias total_count) (children 1)
                   ExpressionList (children 1)
                    Asterisk
                  Function SUM (alias facebookHits) (children 1)
                   ExpressionList (children 1)
                    Function if (children 1)
                     ExpressionList (children 3)
                      Function equals (children 1)
                       ExpressionList (children 2)
                        Identifier domain
                        Literal \'facebook.com\'
                      Literal UInt64_1
                      Literal UInt64_0
                  Identifier domain
                 TablesInSelectQuery (children 1)
                  TablesInSelectQueryElement (children 1)
                   TableExpression (children 1)
                    TableIdentifier clicks
                 ExpressionList (children 1)
                  Identifier domain
                SelectQuery (children 3)
                 ExpressionList (children 3)
                  Function COUNT (alias total_count) (children 1)
                   ExpressionList (children 1)
                    Asterisk
                  Function toUInt64 (alias facebookHits) (children 1)
                   ExpressionList (children 1)
                    Literal UInt64_0
                  Identifier domain
                 TablesInSelectQuery (children 1)
                  TablesInSelectQueryElement (children 1)
                   TableExpression (children 1)
                    TableIdentifier transactions
                 ExpressionList (children 1)
                  Identifier domain
          ExpressionList (children 1)
           Identifier domain
          ExpressionList (children 1)
           OrderByElement (children 1)
            Identifier domain
          Literal UInt64_10
     TableJoin (children 1)
      ExpressionList (children 2)
       Identifier total
       Identifier domain
   ExpressionList (children 2)
    OrderByElement (children 1)
     Identifier total
    OrderByElement (children 1)
     Identifier domain
