I have clearance orders and I need to SELECT orders information’s and only Head of department can see the orders this is the QUERY
<code>SELECT ID_NO,
EMP_NO,
EMP_REASON,
ORDER_DATE,
ORDER_USER,
ORDER_STATUS,
A.START_DATE ,
A.END_DATE ,
ACCEPT_HOD,
ACCEPT_CUST ,
a.dept_id
from CLEARANCE_ORDERS A , CLEARANCE_EMP_INFO B
where a.emp_no = b.emp_id
</code>
<code>SELECT ID_NO,
EMP_NO,
EMP_REASON,
ORDER_DATE,
ORDER_USER,
ORDER_STATUS,
A.START_DATE ,
A.END_DATE ,
ACCEPT_HOD,
ACCEPT_CUST ,
a.dept_id
from CLEARANCE_ORDERS A , CLEARANCE_EMP_INFO B
where a.emp_no = b.emp_id
</code>
SELECT ID_NO,
EMP_NO,
EMP_REASON,
ORDER_DATE,
ORDER_USER,
ORDER_STATUS,
A.START_DATE ,
A.END_DATE ,
ACCEPT_HOD,
ACCEPT_CUST ,
a.dept_id
from CLEARANCE_ORDERS A , CLEARANCE_EMP_INFO B
where a.emp_no = b.emp_id
the query show all orders but I need to select all orders and manager only can see these orders
I added the manager ID and second manager ID in the orders table in the column
<code> A.HOD_EMP_ID
A.CUST_EMP_ID
</code>
<code> A.HOD_EMP_ID
A.CUST_EMP_ID
</code>
A.HOD_EMP_ID
A.CUST_EMP_ID
So how can I select all the employees orders where there manager = HOD_EMP_ID or CUST_EMP_ID ?