📅  最后修改于: 2022-03-11 15:05:08.798000             🧑  作者: Mango
select A.name,
CASE WHEN B.name IS NOT NULL
THEN 1
ELSE 0
END
from table1 A
left join table2 B
on A.name = B.name