Would this give you what you want? 

 SELECT j.id, j.created, COUNT(mj.mid),
        SUM(CASE WHEN ml.state <> 11 THEN 1 ELSE 0 END) AS tally_1,
        SUM (CASE WHEN ml.state IN(2,5) THEN 1 ELSE 0 END)AS tally_2
   FROM j, mj, ml 
  WHERE j.fkey = 1 
    AND mj.jid = j.id 
    AND ml.jid = j.id;

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

Reply via email to