Skip to content

Calculate a column based on if else condition

I am trying to calculate the discounted cost for an account based on its product codes where different codes get different discounts. I am struggling to find a way where I can modify the query so that …

SQL subquery , using WHERE & ‘IN’ to filter for specific rows

please use here and copy the code in below to add context to my questions. As you see, I have a table and within it certain Father’s have the same name, I want to choose the father that has the most dogs for my final list. You can see the entire table in Query #1 , my desired result in