Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL syntax using join(?)
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00890101
Message ID:
00890106
Vues:
20
You must join two tables (I think You want to select records from lots not from status:
1)
***********
event1val = 19432 && id of first eventlevel
event2val = 19412 && id of second event level

select status.date, status.name, ;
status.status_id, status.stats_id, lots.lots_id ;
from lots, status ;
where lots.lots_id = status.lots_id ;             && and status.lots_id = lots.lots_id ;
AND status.stats_id == event1val ;

GROUP BY lots_id 
into CURSOR showme
************
2)
***********
event1val = 19432 && id of first eventlevel
event2val = 19412 && id of second event level

select status.date, status.name, ;
status.status_id, status.stats_id, lots.lots_id ;
from lots;
LEFT JOIN Status ON Lots.Lots_Id == status.lots_id; 
where status.stats_id == event1val ;
GROUP BY Lots.lots_id 
into CURSOR showme
************
(never tested)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform