Table 이름이 NT이고
BB CC DD <- 필드명
1 1 10 <- 레코드 데이타
1 2 20
1 3 30
2 1 40
2 2 50
2 3 60
3 1 70
위에 값을 아래와 같이 하면
select iif(cc = 1,dd,0), iif(cc=2,dd,0),iif(cc=3,dd,0) from nt group by bb,cc,dd
10 0 0
0 20 0
0 0 30
40 0 0
0 50 0
0 0 60
70 0 0
이렇게나옵니다.
저는 Group By 로 묶어서
10 20 30
40 50 60
70 0 0
이렇게 나오게 하려고 하는데 잘 안됩니다. Group by bb 만해주면 될것 같지만
can't format message 13:896 -- message file C:\Program Files\HK-Software\IBExpert\firebird.msg not found.
Dynamic SQL Error.
SQL error code = -104.
Invalid expression in the select list (not contained in either an aggregate function or the GROUP BY clause).
이런 에러 가 나타납니다. 해결 방법좀 알려주세요 Firebird의 한계인가요?
|