SQL Server使用子查询和CTE提供数据之关系除(二)

2014-11-24 14:45:07 · 作者: · 浏览: 2
oductCategory.ProductCategoryname='玩具'
)
and
--购买的玩具种类
count(distinct ToysOrder.ProductCode)=
(
--商品中的玩具种类
select count(ProductCode) from Product
inner join PrductCategory on Product.ProductCategoryID=ProductCategory.ProductCategoryID
where ProductCategory.ProductCategoryname='玩具'
)