Select the product you need help with
- Internet Explorer
- Windows Phone
- More products
You receive an error message when you perform a query that contains an alias that has the same name as two or more columns in the ORDER BY clause
Article ID: 890771 - View products that this article applies to.
When you try to perform a query in Microsoft SQL Server 2000, you receive the following error message:
This problem occurs when the following conditions are true:
Server: Msg 169, Level 15, State 3, Line 8
A column has been specified more than once in the order by list. Columns in the order by list must be unique.
This problem occurs because the ORDER BY clause list must be unique. When an alias that has the same name in the SELECT clause is specified, the ORDER BY clause list is no longer unique.
To work around this problem, you must make sure that the alias that you specified in the SELECT clause is unique if you are going to include the column in the ORDER BY clause list. For example, when you run the following Transact-SQL script, no error message is returned:
Article ID: 890771 - Last Review: November 2, 2007 - Revision: 1.5