UNION but with excused columns
UNION but with excused columns
От:
Mike Rowan <michael.rowan3@gmail.com>
Дата:
I would like to use UNION to amalgamate two result sets, but I need to excuse some columns (the same columns in each set) from the matching requirement. The unmatched columns are the same data type, but not the same data.
Is this possible, and if so, any clues?
Thanks for any ideas
Mike
Re: UNION but with excused columns
От:
David Rowley <david.rowley@2ndquadrant.com>
Дата:
On 28 May 2018 at 13:36, Mike Rowan wrote: > I would like to use UNION to amalgamate two result sets, but I need to > excuse some columns (the same columns in each set) from the matching > requirement. The unmatched columns are the same data type, but not the same > data. > > Is this possible, and if so, any clues? Yes, just use a sub-query: e.g: SELECT a,b,c FROM (SELECT a,b,c,d FROM t1 UNION SELECT a,b,c,d FROM t2) t; -- David Rowley http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services