Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2020
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. -- qry2 this is the value for Col 'D'
  2. SELECT ts.tch_code
  3. , sd.hod_tch_code
  4. , st.sub_type
  5. , st.qual_code
  6. , st.export_code
  7. FROM subtab st
  8. INNER JOIN subcat sc ON (sc.cmpy_code = st.cmpy_code AND sc.sub_cat = st.sub_cat AND sc.scsa_flg = 'C')
  9. LEFT OUTER JOIN tchsub ts ON (st.cmpy_code = ts.cmpy_code AND st.sub_code = ts.sub_code)
  10. LEFT OUTER JOIN subdept sd ON (sd.cmpy_code = st.cmpy_code AND sd.dept_code = st.dept_code)
  11. WHERE st.cmpy_code = '01'
  12. AND st.export_code = 'CERT3EC' -- qry.export_code
  13. AND (st.yr12_su1 = 'Unit1' -- qry.unit_code
  14. OR st.yr12_su2 = 'Unit1') -- qry.unit_code
  15. AND st.sub_type IN ('COS','VET')
  16. AND ts.year_num = 2019
  17. AND ts.year_grp = 11
  18. ORDER BY sd.hod_tch_code, ts.tch_code
  19.  
  20. -- M, N, O - teacher details from either qry2.hod_tch_code or qry2.tch_code
  21. select * from teacher
  22. where cmpy_code = '01'
  23. and tch_code = 'AJ'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement