SQL Server Error Code – 145 order by items must appear in the select

In this blog post, you’ll learn more about the SQL Server Error Code 145 and the error message description that is shown

SQL Server Error Code

145

SQL Server Error Description for the Code :145

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