I'm trying to do a query that will enter a procedure but I'm not having success, the query looks like this:
UPDATE
sca_lotacao AS t0
SET
t0.ativo = 0
WHERE (
SELECT *
FROM
sca_pessoa AS t1
RIGHT JOIN sca_lotacao AS t2 ON t1.idLotacao = t2.idLotacao
WHERE
t1.matricula IS NULL);
Error:
Operand should contain 1 column(s)
I know there must really be something wrong, but I'm trying to figure it out. In SELECT I make to make the selection of all the fields of the Loan that does not have registration and assign them the value of 0 (inactive), but I do not know if this logic is very well.
From what I can see, I can bring all the stockings that nobody has.