All pastes #28290 Raw Edit

Something

public text v1 · immutable
#28290 ·published 2005-11-10 21:53 UTC
rendered paste body
select CustomerID from plans where 
(
(select count(planID) from plans X where X.CustomerID=CustomerID) = 

( select count(planid) from plans Y where Y.Customerid=Customerid and Y.Closed=0 )

);