제가 작성한 쿼리가 있는데..
위와같은 데이터를 구하려면 어떤 곳을 수정해야 하는지좀..
좀 보시고 조언좀 해주시면 감사하겠습니다!! 부탁좀 드립니다!!
select distinct test.t4,
av from table(multiset(
select T.t4, round(avg(aa),0) as av
from
table(multiset(
SELECT t4, t7 as aaFROM test
where T1='108' and t2 = '2003'
union all
SELECT t4, t10 as aaFROM test
where T1='108' and t2 = '2003'
union all
SELECT t4, t13 as aaFROM test
where T1='108' and t2 = '2003'
union all
SELECT t4, t16 as aaFROM test
where T1='108' and t2 = '2003'
union all
SELECT t4, t19 as aaFROM test
where T1='108' and t2 = '2003'
union all
SELECT t4, t22 as aaFROM test
where T1='108' and t2 = '2003'
union all
SELECT t4, t25 as aaFROM test
where T1='108' and t2 = '2003'
union all
SELECT t4, t28 as aa FROM test
where T1='108' and t2 = '2003'
)) T
group by T.t4
))tt, test where tt.t4 = test.t4
|
|