하위 문자열로 그룹화하려고하는데 별칭을 사용할 수 없다는 것을 알고 있지만이 경우에도 결과가 나오지 않습니다.Substr을 사용하여 SQL 그룹 By
select
substr(cd_orig_bic,5,2) cd,
case
when substr(CD_TXN_TYPE,1,1) = '1' then 'a'
when substr(CD_TXN_TYPE,1,1) = '2' then 'b'
else 'OTHER'
end txn_type,
d_booking,
d_value,
d_execution,
from c.c_t_transaction_queue a join c.c_d_currency b on a.id_currency=b.id_currency
where
d_effective>=to_date('01.01.2017','DD.MM.YYYY')
and
d_effective<=to_date('30.09.2017','DD.MM.YYYY')
and substr(cd_orig_bic,5,2)!='SK'
group by substr(cd_orig_bic,5,2);
어느 [DBMS] (https://en.wikipedia.org/wiki/DBMS) 제품이 사용중인 ? 포스트그레스? 신탁? "_SQL_"은 쿼리 언어 일뿐 특정 데이터베이스 제품의 이름은 아닙니다. –
제품 고유의 기능이 많이 있습니다 ... 그리고 GROUP BY는 유효한 ANSI SQL이 아닙니다. – jarlh
안녕하세요 .. 오라클 SQL 개발자 – LuciaK