单纯你这个例子:
select customer from orders where orderprice in(select distinct orderprice from orders where  customer='c')
应该可以,但是in和=有不同的使用范围

解决方案 »

  1.   

    前面的也说到,in用于多值,=用于一个值。
    假设用户c购买价格不重复的价格有多个,可以采用楼上的写法;不重复的价格只有一个可以采用select customer from orders where orderprice =(select distinct orderprice from orders where  customer='c')总之,此种情况使用in是没有问题,而=的使用情况比较特殊。