Skip to content
Advertisement

SQL Optimization, Nested Query on the same table

i have to create a query that return employees having mutliple territories parent for the same function code :

Table employee_territory_function

Table territory

the result must be the employee_id 12346 which have multiple parents

my query was :

The query takes much time execution with 10k for the couple ( employee , function code ) is there a way to optimize or rewrite the query differently ?

Advertisement

Answer

Based on your sample data

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement