Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
I'm trying to select a list of records from 4 tables. What I want is to select only records from the parent table (CASELIST) where the record id is the intersection of CASELIST, ACTLIST, CASEPERLIST (only records whose key value is in all three tables). But I only want to select the records in CASEPERLIST that Inner join with a fourth table (PERSONLIST).
Could anyone tell me if this syntax is correct.
Select DISTINCT CaseList.* From ;
CaseList Inner Join ActList ;
Inner Join CasePerList ;
Inner Join PersonList ;
ON PersonList.cPerson_id = CasePerList.cPerson_id ;
ON CasePerList.cCase_id = ActList.cCase_id ;
ON ActList.cCase_id = CaseList.cCase_id ;
Into Cursor CaseSQL
Is there a better way (sequential rather than nested Joins) to write this?
TIA
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement