CREATE TABLE one_many
(name VARCHAR2(20),
acc_num VARCHAR2(20))
INSERT ALL
INTO one_many VALUES ('abc','a-110')
INTO one_many VALUES ('def','b-256')
INTO one_many VALUES ('xyz','v-586')
INTO one_many VALUES ('uij','o-451')
INTO one_many VALUES ('pqr','')
INTO one_many VALUES ('abc','a-120')
INTO one_many VALUES ('xyz','v-588')
SELECT * FROM dual;
如何找到一对多的情况,即选择那些名称有多个 acc_num 的?
Desired o/p:
NAME ACC_NUM
abc a-110
abc a-120
xyz v-586
xyz v-588