Can someone help me with this MySQL code? I want to retrieve some date from 2 different tables action and staff.

This is my code:

SELECT ActionID, FeedbackID, StaffID, ActionDate, ActionDetails,
       (SELECT StaffName, Department 
        FROM staff 
        WHERE staff.StaffID=action.StaffID) 
FROM action;


I am getting this error:


  #1241 - Operand should contain 1 column(s)
Seems like you want to inner join the two tables on their Primary Keys.  Does this run for you:

CODE:

SELECT 
    A.ActionID, A.FeedbackID, A.StaffID, A.ActionDate, A.ActionDetails,
    S.StaffName, S.Department

FROM Action AS A
    INNER JOIN Staff AS S ON Action.ActionID = Staff.ActionID