Organizational Research By

Surprising Reserch Topic

Experts Most Trusted Topic


any other option is there without using oracle analytical function using -'sql,oracle'


any other option is there without using oracle analytical function  using -'sql,oracle'

can someone help me to resolve this?

CREATE TABLE TT (
     A NUMBER PRIMARY KEY,
     B VARCHAR2(5)
);

insert into tt values (11,'A');
insert into tt values (12,'A');
insert into tt values (13,'B');
insert into tt values (14,'B');
insert into tt values (15,'C');
insert into tt values (16,'D');
insert into tt values (17,'E');
insert into tt values (18,'E');
insert into tt values (19,'F');
insert into tt values (20,'F');

COMMIT;

SELECT * FROM TT;

+---+---+
| A | B |
+---+---+
|11 | A |
|12 | A |
|13 | B |
|14 | B |
|15 | C |
|16 | D |
|17 | E |
|18 | E |
|19 | F |
|20 | F |
+---+---+


My requirement is what are the 'B' column has mapped more than one of 'A' columns Like (value ‘E’ has mapped two rows in column of ‘A’)
o/p

+---+
| A |
+---+
| 11|
| 12|
| 13|
| 14|
| 17|
| 18|
| 19|
| 20|
+---+


I've achieved using below analytical query. I want to know whether it’s possible to archive using without analytical fucntion.

select a
from (SELECT tt.*, COUNT(*) over (partition by b) cnt
      FROM TT
     )
where cnt >= 2;



    

asked Sep 7, 2015 by rajesh
0 votes
2 views



Related Hot Questions



Walkin Jobs Opening



Government Jobs Opening


...