select 客户id from 表a where 商品id in (商品1的id,商品2的id);

解决方案 »

  1.   

    select * from a where 客户id in (select 客户id from a where 商品Id=1) and 客户id in (select 客户id from a where 商品Id=2)
      

  2.   

    select distinct 客户id  from table1 where 商品Id=1 and 商品Id=2
      

  3.   

    No news is good news!
      

  4.   

    select 客户id from 表a where 商品id in (商品1的id,商品2的id);
    是错误的
    select 客户id from 表a where 客户id in (select 客户id where 商品id =2) and 商品id =1
      

  5.   

    已经解决了,我是这样写的
    select distinct 客户id from a where 客户id in (select 客户id from a where 商品id=1  union select 客户id from a where 商品id=2)
      

  6.   

    select 客户id from 表a where 客户id in (select 客户id where 商品id =2) and 商品id =1
    我这个效率最高呀