Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Got an error ORA-00933: SQL command not properly ended

128a3729-bf59-4e8e-84c0-2bfcf23cf255Jul 11 2016 — edited Jul 12 2016

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";

This post has been answered by Barbara Boehmer on Jul 12 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 9 2016
Added on Jul 11 2016
3 comments
423 views