Hi All,
Input Query:
with t as
(select 1 id , 'IND' team from dual
union all
select 2 id , 'ENG' team from dual
union all
select 3 id , 'AUS' team from dual)
select * from t;
Expected Output:
TeamA TeamB
IND ENG
IND AUS
ENG AUS
I want to generate unique combination of teams.
I'm trying this query:
with t as
(select 1 id , 'IND' team from dual
union all
select 2 id , 'ENG' team from dual
union all
select 3 id , 'AUS' team from dual)
select t1.team,t2.team from t t1, t t2
where t1.team<>t2.team;
how to eliminate duplicate rows like if IND> AUS is exist then AUS>IND should not be there.
Please help me out.
Thanks
Ankit Bhatt