sql - SELECT inner joined columns where only one column can not have duplicate record -
i want select inner joined tables, , if there duplicate record in 'column d', not display entire inner joined row. table 1 a b 1 car 1 boat 1 man table 2 c d 1 dog *dog duplicate, display once. 1 dog 1 cat here inner joined sql select statement far: select distinct b c d table1 inner join table2 on table1.a = table2.c <duplicate> not in result result should be: 1 car 1 dog *1 boat 1 dog* <--dog duplicate should not displayed 1 man 1 cat it sounds want arbitrary pairs drawn 2 tables, long second column not have repeated values. whether car/dog or boat/dog unspecified, don't want both. declare @table1 table ( id1 int, value1 varchar(8) ) insert @table1 ( id1, value1 ) values ( 1, 'car' ) insert @table1 ( id1, value1 ) values ( 1, 'boat' ) insert @table1 ( id1, value1 ) values ( 1, 'man' ) declare @table2 table ( id2 int, value2 varchar(8) ) insert @table2 ( id2, value2 ) values ( 1, 'dog' ) in...