문제

I have these three fields that I'd like to combine to make one new one:

DEPT  CRS  SC
-------------
BIO   101  A
BIO   101  B
BIO   105  A
CHEM  101  A

Preferred output:

NEW
-------------
BIO 101A
BIO 101B
BIO 105A
CHEM 101A

I have a feeling I would use NVL()?

도움이 되었습니까?

해결책

Try this: select DEPT||" "||CRS||SC as new from table

다른 팁

You could try with this query

SELECT A.DEPT, A.CRS || A.SC AS NEWCOLUMN
FROM YOURTABLE A

You could also create a view to make it easier to use in the future.

CREATE VIEW SUMMARY AS
SELECT DEPT || ' ' || CRS || SC AS NEWCOL
FROM YOURTABLE;
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top