【发布时间】:2021-12-01 16:04:36
【问题描述】:
我有 2 行
code name
1 cake
2 chocolate
这个查询给了我两个结果
select * from table a where a.code=2 or a.code =1
如果其中一条记录未显示,我不想检索任何内容。
select * from table a where a.code=2 or a.code =1
and exists ( select 1 from table b where a.code=b.code )
【问题讨论】: