Here is original request from senior:
1. Create SQL statement that joins oprfile, cpy_file and div_file tables for oracle user MAC on sun5.
For each record in oprfile (excluding all records where of_coy = '50' and of_dept = '999')
2.1. Extract cpy_snam1 column from cpy_file table, concatenated with "/", then concatenated with di_short_name column from div_file table, then
concatenated with SPACE, and finally concatenated with of_name column from oprfile table.
here is my code:
senior says i need to make changes for company 50 as well
what is wrong with this script?
1. Create SQL statement that joins oprfile, cpy_file and div_file tables for oracle user MAC on sun5.
For each record in oprfile (excluding all records where of_coy = '50' and of_dept = '999')
2.1. Extract cpy_snam1 column from cpy_file table, concatenated with "/", then concatenated with di_short_name column from div_file table, then
concatenated with SPACE, and finally concatenated with of_name column from oprfile table.
here is my code:
Code:
select o.of_opid, c.cpy_snam1|| '/' ||d.di_short_name||' '||o.of_name
from mac.cpy_file c, mac.div_file d, mac.oprfile o
where o.OF_COY = c.CPY_CODE
and o.OF_COY = d.di_coy
and o.OF_DIV = d.di_code
and o.of_coy != '50'
and o.of_dept not in '999'
group by o.of_opid,c.CPY_SNAM1,d.DI_SHORT_NAME,o.OF_NAME;
senior says i need to make changes for company 50 as well
what is wrong with this script?