SQL condition on firstname and lastname without append or concat -
you have 2 tables customers , blacklist, both columns firstname , lastname.
how find customers? please note cannot append or concatenate lastname firstname(or vice versa) because of character limit.
i think left join work. please confirm.
select c.lastname,c.firstname curtomers c left join blacklist b on (c.lastname = b.lastname , c.firstname = b.lastname) b.firstname null , b.lastname null
select c.* customer c not exists ( select * blacklist b c.firstname = b.firstname , c.lastname = b.lastname )
i assume you're inferring "good customer" 1 not in blacklist
table? also, have no idea dbms you're using.
Comments
Post a Comment