您可以尝试以下查询。
如果您希望每个表作为行:
SELECT 'Table1' AS Tbl, COALESCE((SELECT 'Yes' FROM Table1 WHERE Name = 'Joe'),'No') AS Exist
UNION ALL
SELECT 'Table2', COALESCE((SELECT 'Yes' FROM Table2 WHERE Name = 'Joe'),'No') AS Exist
UNION ALL
SELECT 'Table3', COALESCE((SELECT 'Yes' FROM Table3 WHERE Name = 'Joe'),'No') AS Exist
或者,如果您想要单行并将每个表作为列
SELECT
CASE WHEN t1.Name IS NULL THEN 'No' ELSE 'Yes' END as Table1
,CASE WHEN t2.Name IS NULL THEN 'No' ELSE 'Yes' END as Table2
,CASE WHEN t3.Name IS NULL THEN 'No' ELSE 'Yes' END as Table3
FROM Table1 t1
FULL JOIN Table2 t2 ON t1.Name = t2.Name
FULL JOIN Table3 t3 ON t1.Name = t3.Name OR t3.Name = t2.Name
AND t1.Name = 'Joe' AND t2.Name = 'Joe' AND t3.Name = 'Joe'
SQLFiddle 演示