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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UNION SELECT -1 1

Status
Not open for further replies.

lorca

Technical User
Dec 20, 2005
64
GB
Hi

I have a temp table with 17 columns (Col001 - Col017)
i'm trying to retrieve Col003 but do a union select -1 as

Code:
SELECT DISTINCT PARSENAME(REPLACE(Col003, '/', '.'), 1) AS Expr1
FROM Temp
UNION
SELECT -1, '--All Licence Types--'

it says must have equal number of expressions in their target, I've tried everything but cannot get it to work

thanks
keith
 
If first select you have ONLY one field selected (Expr1) in Union you try to get TWO fields: -1 and '--All Licence Types--'

Borislav Borissov
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top