我有这样的篮球桌:
BasketTable
BasketID - ProductID - Total
1 | 1 | 1
2 | 2 | 1
3 | 3 | 1
4 | 4 | 2
我使用此查询(Note : ProductID some times 1,2,3 or 1,2)
select * from BasketTable
where ProductID in (1,2,3,4) and Total > 0
Having Count(*) = 4
查询结果:
BasketTable
BasketID - ProductID
1 | 1
我需要这个
BasketTable
BasketID - ProductID
1 | 1
2 | 2
3 | 3
4 | 4