I have two sql queries as below
1. ;with test as (.........)
select abc from (select ... from test)
2. ;with test1 as (....)
select abc from (select ... from test1)
Both of the queries have the same columns, but different conditions. I want to combine the results of these into a single datafile.
I tried doing query 1 union query 2, but
I am not able to use union as "Incorrect syntax near ';'" when it encounters the ';' of the second query
Copyright Notice:Content Author:「Shree Kiran Vasista」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/48326098/combine-results-of-2-sql-queries-into-1