MySQL Forums
Forum List  »  Newbie

Re: COUNT with Case and Group by
Posted by: Peter Brawley
Date: February 26, 2018 12:19PM

You format SQL to work with it, why not post it formatted?

> It counts the duplicates too

Duplicates of what?

> best way is to Group by categories_id + products_id. But i doesnt work

What does "doesn't work" mean here, exactly?

> WHERE ... ( tep.farbe = 'black1' OR tep.farbe = 'black2' OR tep.farbe = 'black3' ) undoes the left join, you may need ...

left join teppichfarbe tep on tep.teppichnr = p.products_id and tep.farbe in('black1', etc )

To help you with the query, we'll need a complete specification of its requirement in plain English, and the result of Show Create Table for each table referenced in the requirement.

Options: ReplyQuote


Subject
Written By
Posted
February 26, 2018 06:32AM
Re: COUNT with Case and Group by
February 26, 2018 12:19PM
February 27, 2018 04:54AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.