I've been reading various posts in the mysql mailing list that basically say that this functionality (unions, subselects) does not exit within mysql yet (I am just learning php/databases). Is there a way I can run this query in mysql? If not can I fake it out with php? What would the best way to do that be? Thanks in advance, Max "Max Clark" <max@clarksys.com> wrote in message news:... > So I am trying to accomplish something like this: > > select a.domain, a.transport, sum(c.recipient_count) sum(c.recipient_size) > from transport as a, acl as b, recipientstats as c where a.id=b.transportId > and b.adminId='1' and c.recipient_email like '%a.domain'; > > But I know I am missing something because of the error. > > Can anyone point me in the right direction? > > Thanks in advance, > Max > > "Max Clark" <max@clarksys.com> wrote in message > news:ataq2r$ev1$1@main.gmane.org... > > Hi- > > > > I am trying to write a sql query that will output (domain, transport, > > sum(count), sum(size)) from multiple tables for many records. > > > > When the domain field is dynamic based on the adminId passed to the query, > > how do I execute the second query at the same time? > > > > Thanks in advance, > > Max > > > > select a.domain, a.transport from transport as a, acl as b where > > a.id=b.transportId and b.adminId='1'; > > select sum(count), sum(size) from stats where email like '%a.domain'; > > > > > > > > > > > > > > --------------------------------------------------------------------- > > Before posting, please check: > > http://www.mysql.com/manual.php (the manual) > > http://lists.mysql.com/ (the list archive) > > > > To request this thread, e-mail <mysql-thread127356@lists.mysql.com> > > To unsubscribe, e-mail > <mysql-unsubscribe-gcdmg-mysql=m.gmane.org@lists.mysql.com> > > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php > > > > > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php