MySQL Query in Node.js is returning me ‘Subquery returns more than 1 row’:
I heard about INNER JOIN, but I am having hard times to implement it.
My DB Diagram
INSERT INTO tb_atendimento SET tp_senha = (SELECT tp_senha FROM tb_senha WHERE tp_senha = "C" AND nu_senha = ${senhaCaixaChamada}), nu_senha = (SELECT nu_senha FROM tb_senha WHERE tp_senha = "C" AND nu_senha = ${senhaCaixaChamada}), dt_emissao = (SELECT dt_emissao FROM tb_senha WHERE tp_senha = "C" AND nu_senha = ${senhaCaixaChamada}), nu_funcionario = (SELECT nu_funcionario FROM tb_funcionario WHERE nu_funcionario = ${numeroFuncionario}),nu_guiche = (SELECT nu_guiche FROM tb_guiche WHERE nu_guiche=${numeroGuiche}), tp_guiche = (SELECT tp_guiche FROM tb_guiche WHERE nu_guiche = ${numeroGuiche} AND tp_guiche = ${tipoGuiche});
I tried INNER JOIN, but something always go wrong and I get another error.
cyber_pierri is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.