您需要使用其他方法。您将需要使用UNIOn ALL创建具有所有值的内联视图,然后将其与users表保持连接:
SQL小提琴
查询1 :
SELECt a.uid, (CASE WHEN (u.uid is null) THEN 'not found' ELSE 'found' END) as resultFROM (select 1 as UID FROM dual UNIOn ALL select 2 as UID FROM dual UNIOn ALL select 56443 as UID FROM dual UNIOn ALL select 3 as UID FROM dual) as aLEFT JOIN users u on a.uid = u.uid
[结果] :
| UID | result ||-------|-----------|| 1 | found || 2 | found || 3 | found || 56443 | not found |
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)