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

Get distinct records if more than one select column

$
0
0

Hi,

I have a table .

ParentId refid TaskNo [TaskOwner] [UpdatedBy] Remarks Description
100 NULL 100 user2 user2 hi hi
100 100 100.1 user1 user1 this  this 
100 100.2 100.2.1 user2 user1 is  is 
101 NULL 101 user1 user2 the  the 
102 102 102.1 user2 user2 rem desc
103 103.1 103.1.2 user1 user1 rem1 desc1

Previously I able to show parentid where refid is null , but now I would like to show 102,103 values also.

Desired result :


ParentId refid TaskNo [TaskOwner] [UpdatedBy] Remarks Description
100 NULL 100 user2 user2 hi hi
101 NULL 101 user1 user2 the  the 
102 102 102.1 user2 user2 rem desc
103 103.1 103.1.2 user1 user1 rem1 desc1

Please help me to write query..

Thank you.


Viewing all articles
Browse latest Browse all 23857

Trending Articles



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