日期:2014-05-16 浏览次数:21816 次
select t.*, (select t_evolve_weekevolve from t_mk_mission where t_evolve_id = t.t_plan_id and t_evolve_week = t.t_plan_week and t_sys_flag <> -1) as weekevolve from T_MK_PLAN t where t.t_plan_submitflag <> 0 and t.t_plan_week = 4 and t.t_plan_deptid = 48000147100 and t.T_PLAN_YEAR = 2011 and t.t_sys_flag <> -1 order by t.t_plan_id desc
select t_evolve_weekevolve from t_mk_mission where t_evolve_id = t.t_plan_id and t_evolve_week = t.t_plan_week and t_sys_flag <> -1
------解决方案--------------------
根据你的条件T_MK_PLAN 表中的一条数据,在 t_mk_mission表中有多条数据对应。
------解决方案--------------------
(select t_evolve_weekevolve
from t_mk_mission
where t_evolve_id = t.t_plan_id
and t_evolve_week = t.t_plan_week
and t_sys_flag <> -1)
这个子查询返回了多个结果(即有多条记录满足当前的查询条件),就会出现上述错误。
如果该返回结果,只有一条记录,则不会出现错误。
------解决方案--------------------