SelectWithUnionQuery (children 1) ExpressionList (children 1) SelectQuery (children 5) ExpressionList (children 2) Function if (children 1) ExpressionList (children 3) Function greater (children 1) ExpressionList (children 2) Function count (children 1) ExpressionList Literal UInt64_0 Literal \'HAVE PARTS\' Literal \'NO PARTS\' Identifier _state TablesInSelectQuery (children 1) TablesInSelectQueryElement (children 1) TableExpression (children 1) TableIdentifier system.parts Function and (children 1) ExpressionList (children 2) Function equals (children 1) ExpressionList (children 2) Identifier database Function currentDatabase (children 1) ExpressionList Function equals (children 1) ExpressionList (children 2) Identifier table Literal \'data_01660\' ExpressionList (children 1) Identifier _state ExpressionList (children 1) OrderByElement (children 1) Identifier _state