I have two queries
$query1="SELECT staffid, COUNT(staffid) FROM enrll GROUP BY staffid ORDER BY COUNT(staffid) DESC";
$query2="SELECT staffid FROM staff as s WHERE auth = '1' AND NOT EXISTS ( SELECT staffid from shdl as h where s.staffid=h.staffid and h.shdldt='".$unixdt."')";
Both queries are returning values in array, I want to find out those staffid from query1 having inner join with query2 and values would be in array.
NOTE What would be combined query for both query to return final query.
1 Answer