[Dbix-class] JOIN question

Nilson Santos Figueiredo Junior acid06 at gmail.com
Fri Dec 1 03:15:20 GMT 2006


On 11/30/06, Bernhard Graf <dbic2 at augensalat.de> wrote:
> See the example in the first email in this thread.
> You can c&p them in a MySQL-db, for example the test-db, that is there by default on first install.
>
> The first email (email.id=1) has only on text part.
> Second email (email.id=2) is HTML-only.
> Third (email.id=3) is multipart, Text+HTML.
>
> Now my query to find all emails that have only a text part

For your specific situation, you could use this terribly ugly hack
(probably MySQL only) that I'm actually too ashamed to post. Let me
just say that it'd have a single join, would group by the email id and
would do some real nasty stuff in the "having" clause in order to
guarantee you'd only get 'text/plain' mimetypes (think aggregate
functions).

Of course, it's not really a serious solution.

-Nilson Santos F. Jr.



More information about the Dbix-class mailing list