3.6 单行子查询返回多行
作者:互联网
--单行子查询返回多个行 例如:
select c. rca_flag, c.is_card, (select mobile from c_contact t where t.cons_no=c.cons_no) mobile from c_cons c where c.cons_no='1011221125' 解决办法:根据业务需要进行规避 1.(select distinct mobile from c_contact t where t.cons_no=c.cons_no) mobile 2.(select mobile from c_contact t where t.cons_no=c.cons_no and rownum=1) mobile 3.(select avg(mobile) from c_contact t where t.cons_no=c.cons_no) mobile 4.(select max(mobile) from c_contact t where t.cons_no=c.cons_no) mobile 5.(select min(mobile) from c_contact t where t.cons_no=c.cons_no) mobile标签:多行,cons,no,mobile,3.6,单行,contact,where,select 来源: https://www.cnblogs.com/zl-programmer/p/15321130.html