I am trying to implement a table in MYSQL with self-relationship, it is a staff registry table, in which the administrator (FA) registers the common employee (FC) It would be registered in the tuple of the FC which FA registered it, I created the codfunc field as the primary key and foreign key in this table to create the auto relationship, if the profile is 1 it is FA, so it registers itself, if it is profile 2 it is a common employee and then it receives the code of the employee who registered it. for example:
CODFUNC profile name codfunc (F.K)
1 Jose 1(F.A) Null
2 João 2(F.C) 1
I just can not do any insert the way I did. How could you create an auto relationship?