Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Help Needed Please!
Message
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00548100
Message ID:
00548231
Vues:
8
I changed the tables and your code

table 1: COMPANY
companynam C,30
ckey N,3

Table 2: DIVISION
div_name C,50
ckey N,3

and in your code:

close tables all
select a.ckey, a.companynam, b.ckey DivID, b.div_name ;
from Company A join Division B on a.ckey = b.ckey ;
group by a.ckey into cursor crsTemp1 nofilter

select a.ckey, a.companynam, b.ckey DivID, b.div_name ;
from Company A join Division B on a.ckey = b.ckey ;
where b.ckey not in (select DivID from crsTemp1) ;
into cursor crsTemp2 nofilter

select * from crsTemp1 ;
union ;
select ckey, space(30) CompanyNam, DivID, div_name ;
from crsTemp2 order by 1, 2 desc ;
into cursor crsResults nofilter

*select crsTemp1
*browse last nowait
*select crsTemp2
*browse last nowait
select crsResults
browse last nowait

I come up with ONLY 1 record even though I have 3 child records.
Kevin Scott
kehvn@carolina.rr.com


Hey! It's not my fault. It's some General named Protection!
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform