Newbie - Is this possible with mysql? can i fake it in php?
| From: | Max Clark | Date: | Thu, 12 Dec 2002 21:53:48 +0000 |
| Subject: | Newbie - Is this possible with mysql? can i fake it in php? | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-24103@lists.php.net to get a copy of this message | ||
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
> >
> >
>
>