MySQL Forums
Forum List  »  General

Re: mysql pivot dynamic tables and return only where count > 0
Posted by: Peter Brawley
Date: March 29, 2016 10:44AM

> if I add a 16th case I don't have to manually add another line

For several example part solutions see ...

- "Pivot tab;es" at http://www.artfulsoftware.com/queries.php

- http://mysql.rjweb.org/doc.php/pivot

> and I would like to return only cases that have results > 0.

An aggregating Select column can't know what it will find, so do such filtering in an outer query.

Options: ReplyQuote


Subject
Written By
Posted
Re: mysql pivot dynamic tables and return only where count > 0
March 29, 2016 10:44AM


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.