Sub Query Resolution Help SSIS
Hi, I have a requirement wherein I need to implement subquery in SSIS. I am new to the tool and would like to have a guidance on the best approach path to implement this in SSIS package. Below is the subquery that I need to implement in SSIS. select AA.department_name, AA.Department_Manager_Salary, AA.Department_head_count, BB.Department_Avg_Salary, BB.Department_max_salary, BB.Department_min_salary from ( select departments.department_id, departments.department_name as department_name, employees.first_name as employee_name, employees.salary as Department_Manager_Salary, sum(employees.employee_id) as Department_head_count from employees inner join departments on (departments.department_id = employees.department_id and departments.manager_id= employees.employee_id) group by departments.department_id, departments.department_name, employees.first_name, employees.salary order by departments.department_id asc ) AA, ( select distinct departments.department_id, departments.department_name as dept_name, departments.manager_id, cast (avg(employees.salary)as int)AS Department_Avg_Salary, max(employees.salary)AS Department_max_salary, min(employees.salary)AS Department_min_salary from departments, employees where employees.department_id = departments.department_id group by departments.department_id, departments.department_name, departments.manager_id order by department_id asc ) BB where AA.department_id = BB.department_id Please let me know on this. Thank You, evaEVA05
November 27th, 2010 11:04am

it is better to create a View or Stored Procedure with your whole query and then select from view or execute procedure. http://www.rad.pasfu.com
Free Windows Admin Tool Kit Click here and download it now
November 27th, 2010 12:38pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics