group before join

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John Larsen

    #1

    group before join

    Does anybody know if there is a way to aggregate a table then join it to another table?
    I assume this would be possible with a subquery as in
    SELECT * FROM t1 WHERE t1.a=(SELECT sum(t2.b) FROM t2 group by t2.c);

    Except when I do it with 4.1alpha I get error
    "[root] ERROR 1240: Subselect returns more than 1 record"
    I though that was the whole point of a subselect is that you got more than 1 record



    --
    MySQL General Mailing List
    For list archives: http://lists.mysql.com/mysql
    To unsubscribe: http://lists.mysql.com/mysql?unsub=m...ie.nctu.edu.tw

Working...