哪里有 EXISTS

将在 TableName 中选择记录匹配 TableName1 的记录。

SELECT * FROM TableName t WHERE EXISTS (
    SELECT 1 FROM TableName1 t1 where t.Id = t1.Id)