Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Outer join syntax?
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Outer join syntax?
Miscellaneous
Thread ID:
00571093
Message ID:
00571093
Views:
53
I have two queries that get the number of defects for a set of tasks/subtasks

This one selects the completed tasks for 2000 and 2001
select task.task_num, subtask.stsubtask ;
  from task, subtask ;
  where task.task_num = subtask.sttask and ;
        task.tstatus = "C" and ;
        task.task_num > "20000000" ;
  order by task_num, stsubtask ;
   into cursor temp1	  
This one counts the defects
select temp1.task_num, temp1.stsubtask, count(defect.defect_num) as defect_cnt ;
  from temp1 left outer join defect ;
    on temp1.task_num = defect.task and ;
       temp1.stsubtask = defect.subtask ;
 order by task_num, stsubtask ;
 group by task_num, stsubtask ;
  into cursor temp2	
Is there a way to combine them into one query?

Thanks.
Dennis Lindeman
Next
Reply
Map
View

Click here to load this message in the networking platform