Thanks Nick,

>> I'm trying to display a list of orders, each with the names of the
>ordering
>> client branch and parent company.
>
>SELECT o.orderID, c.clientname, p.clientname
>FROM order o, client c, client p
>WHERE o.clientID = c.clientID
>AND c.parentID = p.clientID

That worked, thanks. It just got a little more complicated though -
I'm getting orders from the branches (ie with a parentID that's NOT
0) but not those orders placed directly by a parent company (ie, with
a parentID of 0).

I tried

SELECT o.orderID, c.clientname, p.clientname
FROM order o, client c, client p
WHERE o.clientID = c.clientID
AND c.parentID *= p.clientID

but that's thowing a syntax error. Any ideas?

Thanks a million,
Kay.
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to