A,B的交集?
select val from t1,t2 where t2id=t2.id
and name in('A','B')
group by val having count(val)>1
A,B,C的交集?
select val from t1,t2 where t2id=t2.id
and name in('A','B','C')
group by val having count(val)>1 任意指定集合
改变name in 的集合即可要想函数一样调用需存储过程
你用什么数据库
select val from t1,t2 where t2id=t2.id
and name in('A','B')
group by val having count(val)>1
A,B,C的交集?
select val from t1,t2 where t2id=t2.id
and name in('A','B','C')
group by val having count(val)>1 任意指定集合
改变name in 的集合即可要想函数一样调用需存储过程
你用什么数据库
想偷懒没成功select val from t1,t2 where t2id=t2.id and t2.name='C'
and val in
(select val from t1,t2 where t2id=t2.id
and name in('A','B')
group by val having count(val)>1 )