Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 ORDER BY items must appear in the select list if

Author  Topic 

vidhya
Posting Yak Master

108 Posts

Posted - 2008-07-17 : 07:13:28

Hi,

This is my query when i execute this, it shows the error like

SELECT distinct vehicles.v_ModelID FROM vehicles INNER JOIN Models ON vehicles.v_ModelID = Models.ModelID WHERE (Models.MID = 2) order by Models.ModelDescription asc

error

ORDER BY items must appear in the select list if Specified

elancaster
A very urgent SQL Yakette

1208 Posts

Posted - 2008-07-17 : 07:22:41
what don't you understand about the error?

Em
Go to Top of Page

elancaster
A very urgent SQL Yakette

1208 Posts

Posted - 2008-07-17 : 07:25:38
and you sure your error wasn't actually...

ORDER BY items must appear in the select list if SELECT DISTINCT is specified

Em
Go to Top of Page
   

- Advertisement -