Counting columns if certain Id

If you want the count:

count(i.IsOnSaleId) as IsOnSaleCount,  

If you just want a 0/1 flag, you could do:

sign(count(i.IsOnSaleId)) as IsOnSaleCount,  
           

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top