سؤال

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