SQL 判断一个值 存在哪张表

2024-12-02 16:30:21
推荐回答(1个)
回答1:

SELECT CASE WHEN a.id='1002' THEN 1
WHEN b.tel='1002' THEN 2
END
AS flag
FROM A LEFT JOIN B
ON 1=1
LIMIT 1