现有一张表
查询时 只保留全都是L的id
效果
---------语句1-----
select b.id, b.types
from test13 b
join (select a.id
from test13 a
where a.id in ('161222215810017765', '161222134814010078')
group by a.id, a.types
having count(a.types) >= 2) aa
on b.id = aa.id
--- -建表--------------------
create table test13
(
id VARCHAR2(32) not null,
types VARCHAR2(32) not null
)
--------插入值--
insert into test13 (id, types)
values ('161222134814010078', 'L');
insert into test13 (id, types)
values ('161222134814010078', 'L');
insert into test13 (id, types)
values ('161222215810017765', 'T');
insert into test13 (id, types)
values ('161222215810017765', 'L');