sgursahaney
Programmer
I would like to list a column from my database in a particular sequence. To accomplish this, I have created a column called SORT_ORDER that allows me to sort the records when I select them. I have the created the following SELECT statement:
SELECT PRODUCT_NAME, SORT_ORDER FROM PRODUCTS
ORDER BY SORT_ORDER ASC
But, I don't want the Sort Order to actually show up in my output. When I take it out, SQL Server complains that I cannot use a column in the ORDER BY clause if it is not specified in the SELECT list. How can I hide the SORT_ORDER column from my output?
Thanks in advance.
SELECT PRODUCT_NAME, SORT_ORDER FROM PRODUCTS
ORDER BY SORT_ORDER ASC
But, I don't want the Sort Order to actually show up in my output. When I take it out, SQL Server complains that I cannot use a column in the ORDER BY clause if it is not specified in the SELECT list. How can I hide the SORT_ORDER column from my output?
Thanks in advance.