Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Statement
Message
 
 
To
17/04/2003 08:53:40
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00778786
Message ID:
00778791
Views:
16
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--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform