Suppose I have two tables
1st table emp
EmpID | EmpName|xyz...coloums
1. | Hrishi |
2. | Nikhil |
3. | Hrishi |
2nd Table Department
DeptId |EmpId |Deptname....Xyz coloum
1. |1 |computer
There is a one-to-many relation between emp and department table.
Now I want to call a stored procedure where empName will be an input. This stored procedure will insert empId in department table where empName = Hrishi. Of course, this is ambiguous.
Which hrishi will get selected from emp table 1st or 3rd?
How should I handle this senario?