[thelist] sql question

Dallas Cahker christmasfruitcake at gmail.com
Tue Apr 11 14:01:00 CDT 2006


This is my query its name is Oliver, beautiful isnt he?  Doesnt work and I
kinda had an idea it wouldnt.  :(

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;

What I am trying to do is get information from three tables (DEALER, ORDER,
DEALER_TM) what I am trying to get specifically is to get all the orders for
a certain dealer manager with them ordered by sub dealers.  The relationship
between dealer manager and sub dealer are in DEALER_TM table, Order
information is in ORDER and the dealerid points to the sub dealer, DEALER
table holds the information about the dealer, and dealer manager.

Any ideas?



More information about the thelist mailing list