I have this query that return invoices made on a certain employee shift
SELECT
i.dateTime,i.amount,i.totalProfit,i.shiftID,
i_o.itemID,i_o.quantity,
item.name itemName,
p.full_name
from invoice i
LEFT JOIN
inv_order i_o on i_o.invID=i.invID
LEFT JOIN
`item-service` item on item.itemID = i_o.itemID
LEFT JOIN person p on
p.PID=i.personID
where i.shiftID =97
but then, i need to get the employee name from the employee table, and i only have the shiftID.
SELECT
i.dateTime,i.type,i.amount,i.totalProfit,i.shiftID,i_o.itemID,i_o.quantity,item.name itemName,p.full_name
from invoice i
LEFT JOIN
inv_order i_o on i_o.invID=i.invID
LEFT JOIN
`item-service` item on item.itemID = i_o.itemID
LEFT JOIN person p on
p.PID=i.personID
where i.shiftID =97
UNION
SELECT e.name from employee e
left join shift s on s.empID = e.empID
where s.shiftID =97
the mysql return this error
The used SELECT statements have a different number of columns