same alias more than once in select
Hi,
What do you think about this query? The 2nd, 3rd and 4th dataset have same alias (B) :
select A.id, B.DATA from
(select level id, 'a' data from dual connect by level <= 2) A
inner join (select level id, 'B' data from dual connect by level <= 2) B on (B.id = A.Id) --B1
inner join (select level id, 'C' data from dual connect by level <= 2) B on (B.id = A.Id) --B2
inner join (select level id, 'D' data from dual connect by level <= 2) B on (B.id = A.Id) --B3
;
--the result is:
1 B
2 B
"B.DATA" in the result means the DATA column of the "first B" alias. The result contains 2 records, so the "