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

Get Distinct on only one column

$
0
0

I am using this below query to generate this below result set. I want to display only one record as blank, it should not be duplicate records.

SELECT [MDMTerminalID],  ISNULL([TerminalAlias], 'BLANK')  , [RegionID] FROM [dbo].[Terminal]
Union
select -1,'All', (select top 1 areaid from area where name = 'Other')


Viewing all articles
Browse latest Browse all 7129

Trending Articles



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