Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL
Message
From
11/09/2000 10:51:45
Cindy Winegarden
Duke University Medical Center
Durham, North Carolina, United States
 
 
To
11/09/2000 10:45:50
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Re: SQL
Miscellaneous
Thread ID:
00414860
Message ID:
00414907
Views:
24
>>There won't be any NULLs without a LEFT JOIN. Otherwise it will only return those that have a matching record in the Orders table.
>>
>>
>>SELECT ;
>>    Orders.Id, ;
>>    NVL(Clients.ClientName, PADR("Sir/Madam", nn)) AS ClientName ;
>>    FROM Orders LEFT JOIN Clients ON Orders.Id = Clients.Order_id;
>>    INTO CURSOR Temp ;
>>    ORDER BY.....
>
>There will if the client table has stored .NULL. in the name.
>I assumed that was the situation, since you wouldn't need to have a "Dear Sir/Madam" for a customer that had no order...

Trey,

I really should have said "have a matching record in the _Clients_ table."

Sherry has an ORder_id in the clients table which means that she's keeping a name for each order, or not as the case may be.

Most of us would have the client being the parent and insist on having a client set up before they could place an order, but she may have a system where they are "cash" customers and don't always get all the client details - though I don't know how you would send out a letter without details.

Maybe Sherry should re-assess her design if things aren't too far along.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform