log
id user productselect distinct l.user,l.product from log l where l.user in(
select distinct l1.user from log l1,log l2 where l1.id!=l2.id and l1.user=l2.user and l1.product='P1'
and l2.product='P2' )
id user productselect distinct l.user,l.product from log l where l.user in(
select distinct l1.user from log l1,log l2 where l1.id!=l2.id and l1.user=l2.user and l1.product='P1'
and l2.product='P2' )
然后就是产品表里面有产品的信息 就这么2个表来查询
from users u,products p
where u.userid=p.userid
and (p.pname='产品1' or p.pname='产品2')
where userid in
(
select userid from products
where pname="产品1"
)
and userid in
(select userid from products
where pname="产品2"
)
不知lz怎么弄的