Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UNION ALL syntax error

Status
Not open for further replies.

capronton

MIS
Jun 28, 2013
159
US
Can someone explain why I get an error with the syntax below. Thanks.

SELECT * as "Route",
"All"as "Description"

UNION ALL

SELECT route.route_alpha,
route.route_alpha as "Description"
FROM route
 
You can't select "*" from nothing - you need to give a dummy value to the Route field like you are to the Description field. Based on the second part of the union, I'm going to assume that Route is a string field. In this case, your query would look like this:

Select 'All' as Route, 'All' as Description

UNION ALL

Select route_alpha, route_alpha
froum route

-Dell

DecisionFirst Technologies - Seven-time SAP BusinessObjects Solution Partner of the Year
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top