Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

Distinct Logic - forum topic by bikky6

$
0
0

I have a table like
ct table1(name1 varchar(10),name2 varchar(10))
ins into table1 values('ABC','XYZ')
ins into table1 values('ABC','ABC')
ins into table1 values('XYZ','DEF')
ins into table1 values('ABC','DEF')
ins into table1 values('GHI','DEF')
I want my output to be
I need distinct names with the indicators like below
NAME NAME1 NAME2
ABC  Y Y
XYZ Y Y
DEF Y Y
GHI Y N

Forums: 

Viewing all articles
Browse latest Browse all 14773

Trending Articles



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