Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

SQL Select - Union 1 specific item and want this item alway stay on top

$
0
0

Hi,

I have a simple query to load the company department but I want to Add "All Departments" item. I

wanted "All Items' always on the top of the result and all other dept will be sort desc.  Please advise how can I do this.

SELECTDISTINCT [department] from Company 

UNION

SELECT'All Departments'as Dept

Thanks,

Ddee

 


Viewing all articles
Browse latest Browse all 7129

Trending Articles



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