Obviously, the problem for the poster was solved more than half a century ago, however, I wanted to tell everyone who reads this message, in search of help, so that the order of the selected properties (columns) should coincide with one combined operator for the next. It is not enough to simply combine names and data types, although this is, in a sense, the main reason. But due to the way Union instructions are processed in Oracle, you can get ORA-01790 error due to inconsistency in column ordering.
In my case, I had a query with UNION ALL of two options. One of them had a column named "generic_column_name" as the 25th element in the select element, and the other had the same column named "generic_column_name" of the same data type (I checked several ways using hard coding, as well as using forced data type conversions). However, the second choice had this element in 19th place, so all the columns from there were offset, and this caused error ORA-01790.
source share