[thelist] sql question

Dan McCullough dan.mccullough at gmail.com
Tue Apr 11 14:42:47 CDT 2006


No results.
+----------------+--------------+------+-----+---------+-------+
| Field          | Type         | Null | Key | Default | Extra |
+----------------+--------------+------+-----+---------+-------+
| dealerid       | int(11)      | NO   | PRI | 0       |       |
| email          | varchar(70)  | NO   |     |         |       |
| password       | varchar(32)  | NO   |     |         |       |
| name           | varchar(150) | YES  |     | NULL    |       |
| company        | varchar(150) | YES  |     | NULL    |       |
+----------------+--------------+------+-----+---------+-------+

+----------+---------+------+-----+---------+-------+
| Field    | Type    | Null | Key | Default | Extra |
+----------+---------+------+-----+---------+-------+
| dealerid | int(11) | NO   | PRI | 0       |       |
| subid    | int(11) | NO   | MUL | 0       |       |
+----------+---------+------+-----+---------+-------+

+-----------------+-------------+------+-----+---------+-------+
| Field           | Type        | Null | Key | Default | Extra |
+-----------------+-------------+------+-----+---------+-------+
| orderid         | int(11)     | NO   | PRI | 0       |       |
| dealerid        | int(11)     | YES  |     | NULL    |       |
| billingid       | int(11)     | YES  |     | NULL    |       |
| shippingid      | int(11)     | YES  |     | NULL    |       |
+-----------------+-------------+------+-----+---------+-------+

On 4/11/06, Matt Warden <mwarden at gmail.com> wrote:
> On 4/11/06, Dallas Cahker <christmasfruitcake at gmail.com> wrote:
> > SELECT O.orderid, D.email, D.dealerid, DT.dealerid AS dealeridDT, DT.tmid
> > FROM dealer_tm DT
> > INNER JOIN dealer D
> >  ON D.dealerid = DT.dealerid
> > INNER JOIN order O
> >  ON D.dealerid = O.dealerid
> > WHERE DT.dealerid = '0325687A'
> > ORDER BY D.dealerid;
>
> Here's my shot, without seeing your full table structure. If it works
> I can put it into inner join form for you.
>
> select O.orderid, subD.email, subD.dealerid
> from dealer_tm DT, order O, dealer subD
> where O.dealerid=subD.dealerid
>    and subD.dealerid=DT.subdealerid
>    and DT.dealerid='0325687A'
> order by subD.dealerid
>
> If that doesn't help, let us see your table structure (instead of
> describing it narratively) and we'll get you a solution.
>
> hth,
>
> --
> Matt Warden
> Miami University
> Oxford, OH, USA
> http://mattwarden.com
>
>
> This email proudly and graciously contributes to entropy.
> --
>
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
>
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org
> Workers of the Web, evolt !
>



More information about the thelist mailing list