[freeside-devel] mysql and complex queries

Dave Burgess burgess at neonramp.com
Tue Nov 27 10:43:32 PST 2001

I've been playing around with the select, and I was wondering if this query
generates the right result dataset:

select * from cust_pkg
  left outer join part_pkg using (pkgpart)
    left outer join cust_main on (cust_main.custnum = cust_pkg.custnum)
      left outer join cust_svc on (cust_svc.pkgnum = cust_pkg.pkgnum)
        left outer join part_svc using (svcpart)
          left outer join svc_acct on (svc_acct.svcnum = cust_main.custnum)
            left outer join svc_domain on (svc_domain.svcnum =
              left outer join svc_forward using (svcnum)
                order by cust_main.custnum

ivan wrote:

> On Tue, Nov 20, 2001 at 12:29:50PM -0600, Dave Burgess wrote:
> > OK.
> >
> > I've been through the BNF for the SELECT statement in MySQL, and Version
> > 3 doesn't like this particular syntax at all.
> Do you mean to say it works in version 4?
> > - The parentheses might be a problem.  I wasn't able to use them for
> > grouping.
> Hmm, I thought I only used them where required by the JOIN syntax or for
> sub-queries.  Is MySQL missing support for subqueries?


More information about the freeside-devel mailing list