Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Statement
Message
 
 
À
17/04/2003 08:53:40
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00778786
Message ID:
00778791
Vues:
15
This message has been marked as the solution to the initial question of the thread.
Russell,

You can use LEFT OUTER JOIN in this case. You may wrap t2 fileds into NVL() function if you don't want Nulls in the result set.
SELECT t1.*,  t2.actionid, t2.action, t2.adate ;
  FROM table1 t1 ;
    LEFT JOIN table2 t2 ON t1.projectid = t2.projectid ;
  INTO CURSOR crsResult 
>My brain is not working this morning! Can someone please help me with an sql statement that will join the following two tables:
>
>Table 1:
>projectid
>project name
>etc...
>
>Table 2:
>projectid
>actionid
>action
>adate
>
>What I want is a cursor that combines all of the projects from Table 1 with the corresponding actionid, action, and adate from Table 2. I want to include all projects from table 1 regardless of whether it has any actions in Table 2. Hope this makes sense.
>
>Thanks in advance,
>Russell
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform