Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Problem in 3 files
Message
De
23/07/1997 10:22:20
Vinod Parwani
United Creations L.L.C.
Ad-Dulayl, Jordanie
 
 
À
23/07/1997 10:15:17
Monte Murdock
Universal American Mortgage Company
Clearwater, Floride, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00041299
Message ID:
00041328
Vues:
81
>>>>No, I don't want to select duplicate records, I will tell you exactly:-
>>>>
>>>>Parent->Name -> 1 Rec
>>>>Child->contact -> 2 rec (contact nos. of name)
>>>>child->address -> 2 rec (2 address, off, res)
>>>>
>>>>simply I want
>>>>Name from name, phone from contact, address from address
>>>>same way in the second record
>>>>
>>>>name from name, 2nd phone from contact, 2nd address from address.
>>>>
>>>>Now, Pls tell me the way..
>>>>
>>>>SQL is not fun...Always I face problem in it...
>>>
>>>As I understand it, child1 has a contact#1, and the child2 has the address of the contact#1. Next you want contact#2 from child1 and the address of contact#2 from child2. To do this you have to have a key field between child1 and child2 to link the correct address with the contact#.
>>>
>>>Then your SQL would be something like:
>>>
>>>Select parent.Name, child1.Contact, child2.address ;
>>>   from parent, child1, child2 ;
>>>   where parentkey=child1key and child1key=child2key ;
>>>   order by .... group by .....
>>>
>>>
>>>HTH.
>>
>>Thanks, but it is coming same, here is what I am typing
>>Select name.Name, Contact.phone, address.address ;
>> from name, contact, address ;
>> where name.code=contact.code and contact.code=address.code group by name.code
>>
>>but it is giving me one record only...
>
>Try the following.
>
>Select name.Name, Contact.phone, address.address ;
> from name, contact, address ;
> where name.code=contact.code ;
> and contact.code=address.code ;
> group by name.code, contact.code

I'm very sorry to disturb you again but I'm afraid the result is same....

Pls advs..
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform