[storm] Subselect query

Aurélien Bompard aurelien at bompard.org
Wed Jun 12 14:45:30 UTC 2013


Hello everybody,

I have and SQL query that I can't find a way to convert to Storm. Here's
the situation: I have an "email" table, containing, well, emails.
It has a sender_name and a sender_email column.
I'm trying to get the number of emails by sender (a kind of "hall of
tro^Wfame")
This SQL query works:

SELECT DISTINCT sender_name, sender_email,
    (SELECT count(*) FROM email e2 WHERE e2.sender_email =
e1.sender_email) AS number
FROM email e1 ORDER BY number DESC;

Any idea how to do this with Storm? I tried subqueries but it didn't
lead me anywhere, because of the count(*).

Thanks for your help! Cheers,
Aurélien

-- 
http://aurelien.bompard.org    ~~~~~~    xmpp:aurelien at bompard.org
"Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the Universe trying
to produce bigger and better idiots. So far, the Universe is winning."
 -- Rick Cook




More information about the storm mailing list