SelectWithUnionQuery (children 1)
 ExpressionList (children 1)
  SelectQuery (children 4)
   ExpressionList (children 3)
    Function if (alias device) (children 1)
     ExpressionList (children 3)
      Function empty (children 1)
       ExpressionList (children 1)
        Identifier id
      Function toString (children 1)
       ExpressionList (children 1)
        Identifier device
      Identifier id
    Function multiIf (alias device_id_type) (children 1)
     ExpressionList (children 5)
      Function notEmpty (children 1)
       ExpressionList (children 1)
        Identifier id
      Literal \'a\'
      Function equals (children 1)
       ExpressionList (children 2)
        Identifier device
        Literal \'00000000-0000-0000-0000-000000000000\'
      Literal \'b\'
      Literal \'c\'
    Function count (children 1)
     ExpressionList
   TablesInSelectQuery (children 1)
    TablesInSelectQueryElement (children 1)
     TableExpression (children 1)
      TableIdentifier table1
   ExpressionList (children 2)
    Identifier device
    Identifier device_id_type
   ExpressionList (children 1)
    OrderByElement (children 1)
     Identifier device
