子查询就行。字符串截取出姓查询出不在表2中的记录。
select id,NR,’姓氏不在库内’ FK from book1 where SX=‘姓名’ and left(NR,1) not in(select NAM from book2);