Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Sorting (Ordering)

$
0
0

I have an account number field with data as follows

161

All

141

I want ALL at the top and the remaining account numbers in descending order.

I ORDER them by account number DESC and I get:

All

161

141

that is good.

Now, If I have alpha account numbers as well (e.g. U322) the sort becomes

U322

All

161

141

Problem: The "All" value is no longer the first in the list.

Question: How do I sort this data in descending order except that "All" is placed at the top.

Many thanks.



-A


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>