举个例子:
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
);