SQL>please help!!

Results 1 to 3 of 3

Thread: SQL>please help!!

  1. #1
    Join Date
    Dec 1969

    Default SQL>please help!!

    I&#039;m wondering is it possible to use nested sql statements or perhaps execute sql statements on resultsets from previous statements?<BR><BR>My problem goes as follows:<BR><BR>1.I need to minimize employee numbers from table 1, depending on the course selected...<BR>rs1=SELECT Emp_no from TAKEN_COURSES WHERE course_no LIKE &#039;x&#039;<BR>..NO PROBLEM<BR><BR>2.This part makes the whole thing complicated...but SQL below works.<BR>Depending on the course chosen, diff groups are selected, and resultset is returned containing employees in those groups.<BR>SQl goes as follows:<BR><BR>rs2="SELECT Group.Group_ID, Course_Group_REQ.Course_ID, EMP_GROUP.Employee_ID FROM ([Group] INNER JOIN Course_Group_REQ ON Group.Group_ID = Course_Group_REQ.Group_ID) INNER JOIN EMP_GROUP ON Group.Group_ID = EMP_GROUP.Group_ID WHERE (((Course_Group_REQ.Course_ID)=&#039;x&#039;))<BR> <BR>3. I need to compare the results of rs1 and rs2, returning courses not in TAKEN_COURSES but in REQUIRED_COURSES.<BR>I know sql such as SELECT ..FROM..WHERE..NOT IN(...), but i don&#039;t know how to use it in this situation.<BR><BR><BR>I hope somebody can help me with this.<BR>Much appreciated. Thanks!<BR>

  2. #2
    Join Date
    Dec 1969

    Default *Crosspost. DB Forum.

    Try to stick to just one forum -- even if the response is slow, stay there.

  3. #3
    Join Date
    Dec 1969

    Default At least he waited some time first


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts