nodejs中mysql子查询返回多行结果怎么处理

2025-01-02 12:31:44
推荐回答(1个)
回答1:

举个例子:
DELIMITER $$

CREATE DEFINER=`root`@`localhost` PROCEDURE `Select_bad`()
BEGIN
select id,name,age,sex,punch1
from test0
where id = (
select id
from test1
where flag = 0
);
END
查询语句:
select id,name,age,sex,punch1
from test0
where id in --等号改成in
(
select id
from test1
where flag = 0
);