1 Reply Latest reply: Feb 18, 2013 6:33 AM by Roel Hartman RSS

    sql query..

    982242
      SELECT
      DA.COURSE_ID, COUNT(DA.COURSE_NAME), L.COURSE_ID
      FROM COURSE L
      (
      SELECT
      E.EMP_ID,
      E.EMP_NAME,
      D.DEPT_NAME,
      D.DEPT_MAX_EMP,
      E.DEPT_ID,
      J.JOB_PROFILE_ID,
      J.JOB_PROFILE_DESC,
      S.SKILL_ID,
      SC.COURSE_ID,
      C.COURSE_NAME,
      C.COURSE_MIN_EMP,
      S.SKILL_DESCRIPTION,
      CF.FACULTY_iD,
      F.FACULTY_NAME,
      JK.SKILL_LEVEL as JOB_PROFILE_LEVEL ,
      ES.SKILL_LEVEL AS EMP_SKILL_LEVEL,
      TO_NUMBER(JK.SKILL_LEVEL) - TO_NUMBER(ES.SKILL_LEVEL) Gap,
      CASE
      WHEN (TO_NUMBER(JK.SKILL_LEVEL) < TO_NUMBER(ES.SKILL_LEVEL)) THEN 'NO'
      ELSE 'YES' END "TRAINING_REQUIRED"

      FROM

      JOB_PROFILE J,
      JOB_PROFILE_SKILL JK,
      SKILL S,
      EMP_SKILL ES ,
      EMP_MASTER E,
      SKILL_COURSE SC,
      COURSE C,
      COURSE_FACULTY CF,
      FACULTY F,
      DEPT_MASTER D
      WHERE

      J.JOB_PROFILE_ID=E.JOB_PROFILE_ID
      AND
      JK.JOB_PROFILE_ID=J.JOB_PROFILE_ID
      AND
      S.SKILL_ID=JK.SKILL_ID
      AND
      E.EMP_ID=ES.EMP_ID
      AND
      SC.SKILL_ID=JK.SKILL_ID
      AND
      SC.COURSE_ID=C.COURSE_ID
      AND
      C.COURSE_ID=CF.COURSE_ID
      AND
      CF.FACULTY_ID=F.FACULTY_ID
      AND
      E.DEPT_ID=D.DEPT_ID
      AND
      JK.SKILL_ID=ES.SKILL_ID
      ) DA
      WHERE
      DA.COURSE_ID = L.COURSE_ID
      AND
      TRAINING_REQUIRED='YES'
      GROUP BY DA.COURSE_ID





      i want to DA.COURSE_ID = L.COURSE_ID MATCH AND RESULT WILL BE DA.COURSE_ID AND L.COURSE_ID ARE SAME