My query is like follows. Every part of Union works well. Error occurs when I connects them using union. Anyone could be kind tell me why?
| select "SUM"(t1."Vol") as "TotalQuoteVol", 'TYPE1' as "type" |
from "dbname_deal"."deal" t1
| inner join "dbname_account"."Trader" t2 on t2."Id" = t1."TraderID" |
| inner join "dbname_account"."team" t3 on t3."type" = 'TYPE1' and "INSTR"( t2."TeamIdList", t3."Id")>0 |
group by t1."product_name"
unoin
| select "SUM"(t1."Vol") as "TotalQuoteVol", 'TYPE2' as "type" |
from "dbname_deal"."deal" t1
| inner join "dbname_account"."Trader" t2 on t2."Id" = t1."TraderID" |
| inner join "dbname_account"."team" t3 on t3."type" = 'TYPE2' and "INSTR"( t2."TeamIdList", t3."Id")>0 |
group by t1."product_name";