Link to home
Start Free TrialLog in
Avatar of tbaseflug
tbaseflugFlag for United States of America

asked on

Prepend Value to Select

I have a select that I am taking into a stored procedure - which will tehn be bound to a dropdownlist in my html/asp page - what I want to do is to add a "SELECT ALL" value to the single select statement -

SELECT DISTINCT LEFT(Sub, 3) AS SiteID --, CustID
 FROM SIVApplication.dbo.ARTran

Produces:
000
123
456

What I want is:
Select All
000
123
456
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SELECT 'Select All' SiteID
UNION ALL
SELECT DISTINCT LEFT(Sub, 3)
 FROM SIVApplication.dbo.ARTran
Avatar of tbaseflug

ASKER

That works - how would I order by to make certain that the SELECT ALL came first and everythign else was ordered by the other value (SiteID)
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial