When you think ASP, think...
Recent Articles
All Articles
ASP.NET Articles
Message Board
Related Web Technologies
User Tips!
Coding Tips

Sample Chapters
Commonly Asked Message Board Questions
JavaScript Tutorials
MSDN Communities Hub
Official Docs
Stump the SQL Guru!
XML Info
Author an Article
ASP ASP.NET ASP FAQs Message Board Feedback
Print this page.
Published: Monday, September 20, 1999

Parameterized ORDER BY using Oracle

Note from Webmaster (Scott Mitchell): The below text is quoted from an email I received on 9/16/99!

I think Stump the SQL Guru is great! The question about parameterized ORDER BY's especially hit home for me. Unfortunately, your example only works in SQL Server. Below is a sample that works in Oracle, so you can pass it on in case you have any Oracle users out there. Keep it up!

- continued -


SELECT FirstName, LastName, DECODE ( ColumnNumberAsAnInteger ,1 ,FirstName ,2 ,LastName ,1 ) AS SortCol FROM Emp ORDER BY SortCol

Happy Programming!

ASP.NET [1.x] [2.0] | ASPFAQs.com | Advertise | Feedback | Author an Article