什么是"错误代码: 1172 Result consisted of more than one row"?
该怎么修改?
==============================================================
CREATE PROCEDURE p1()
BEGIN
DECLARE m_tid varchar(200);
DECLARE m_title varchar(200);
DECLARE m_content varchar(200);
DECLARE hot_id varchar(200);
DECLARE num_id int;
DECLARE cur_title cursor for select tid,title from t_maps_hot
where title not in (select com_name from t_yp_thread1);
DECLARE continue handler for not found
set m_content='|0|';
open cur_title;
loop
fetch cur_title into m_tid,m_title;
begin
select count(*) into num_id from t_yp_thread1 where com_name=m_title;
if num_id=0 then
SET m_content=concat('|',m_tid,'|');
insert into t_yp_thread1(maps_hot_id,com_name,im) values
(m_content,m_title,m_title);
else
begin
select maps_hot_id into hot_id from t_yp_thread1 where
com_name=m_title;
SET m_content=concat(hot_id,'|',m_tid,'|');
insert into t_yp_thread1(maps_hot_id,com_name,im) values
(m_content,m_title,m_title);
end;
end if;
end;
end loop;
close cur_title;
END$$
--转自