[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 208
  • Last Modified:

Union All Error

The stored procedure that I attached was running fine until I added the last two queries to the CT section. The addition in for Bell Nursery. When I add the queries I get “Incorrect Syntax near the keyword ‘Union’ “, when I try to compile the SP.

The only way to get read of the error in to comment ( as I did ) the new addition.

Is there a limit on the number of Unions I can use in a SP?
Union-Problem.sql
0
GadFriedman
Asked:
GadFriedman
  • 2
1 Solution
 
Simone BCommented:
You need to remove the "order by" clause from the previous select:

order by bill_id,year,month

--/*

Union all

----------------------------------------------------------------------------

--Bell Nursery
0
 
Imran Javed ZiaCommented:
Hi,

Just remove order by or move it to last section


--order by bill_id,year,month

Thanks
0
 
Simone BCommented:
Move it to the end of the last select.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now