Error with Order by

select Distinct -1 as InvestigatorID, Ltrim(Rtrim(p.Name)) as InvestigatorName
Order by p.Name
I get the following error.  How can I fix this?  Thank you.
ORDER BY items must appear in the select list if the statement contains a UNION, INTERSECT or EXCEPT operator.
lapuccaAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
pdd1lanConnect With a Mentor Commented:
select Distinct -1 as InvestigatorID, Ltrim(Rtrim(p.Name)) as InvestigatorName
Order by  InvestigatorName
0
 
lapuccaAuthor Commented:
Ah, great.  Thanks.
0
 
HainKurtSr. System AnalystCommented:
Order by 2

2 represents the second column...
0
All Courses

From novice to tech pro — start learning today.