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: