I have a table of employees, some of which are supervisors.
(ID,NAME,SUP_ID)
When I list them out, I want to mark which ID's are supervisors. E.g.
ID,NAME,SUP_ID,Y/N
It will display Y if any row has a SUP_ID set to ID.
It seems horribly expensive (n^n) to do a count each time. Surely there is an n^2 or even better solution?
(ID,NAME,SUP_ID)
When I list them out, I want to mark which ID's are supervisors. E.g.
ID,NAME,SUP_ID,Y/N
It will display Y if any row has a SUP_ID set to ID.
It seems horribly expensive (n^n) to do a count each time. Surely there is an n^2 or even better solution?