select
(select majorcode from view_major where view_major.majorName = stu_Change.Maojrafter) as MajorAfterCode,
(select classcode from view_class where view_class .classname = stu_Change.Classafter) as ClassAfterCode
from stu_Change
where stu_Change.ID='123456789011'
为什么提示ORA-01427: 单行子查询返回多于一个行啊?
(试验了一下,如果把as MajorAfterCode那行删了,就能执行,但加上as MajorAfterCode这行就不行,但这行在数据库中只有一条记录啊)
------解决方案--------------------
哥 你查出的
select majorcode from view_major where view_major.majorName = ‘数字媒体'
这个查到多条了