Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select doesn't produce expected results
Message
De
25/10/2012 12:12:10
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Select doesn't produce expected results
Divers
Thread ID:
01555800
Message ID:
01555800
Vues:
68
Can someone help me understand this please? Below are 2 select statement that I expect would produce equal results but they do not. The only difference in the statements is the order of the join but one produces 30K records and the other 23K. The left join is also much faster that the right join. So what's going on here? My understanding is that the left join preserves all the records from the table on the left side and the right join preserves all the records on the right side. Since the left table in the first query is the same as the right table in the second, I would expect the results to be the same but they are not. So where am I wrong?
SELECT pagcleanad as infoaddress,pagbusines as infobusiness, INT((mon1_empl+mon2_empl+mon3_empl)/3) as infoemploy, ;
emp as q3Employ, address as q3address, trade_name as q3business ;
FROM q3 ;
left JOIN info ON address=pagcleanad AND trade_name=pagbusines

SELECT pagcleanad as infoaddress,pagbusines as infobusiness, INT((mon1_empl+mon2_empl+mon3_empl)/3) as infoemploy, ;
emp as q3Employ, address as q3address, trade_name as q3business ;
FROM q3 ;
right JOIN info ON pagcleanad=address AND pagbusines=trade_name
Thanks
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform