Oracle SQL - Combine results from two columns

0

I am seeking to combine the results of two columns, and view it in a single column:

select description1, description2 from daclog where description2 is not null;

results two registry:

1st row:

DESCRIPTION1

Initialization scans sent to RTU 1, 32 bit mask: 0x00000048. Initialization mask bits are as follows: B0 - status dump, B1 - analog dump B2 - accumulator dump, B3 - Group Data Dump, B4 - accumulat 

(here begin DESCRIPTION2)

,or freeze, B5 - power fail reset, B6 - time sync.

2nd row:

DESCRIPTION1

Initialization scans sent to RTU 1, 32 bit mask: 0x00000048. Initialization mask bits are as follows: B0 - status dump, B1 - analog dump B2 - accumulator dump, B3 - Group Data Dump, B4 - accumulat

(here begin DESCRIPTION2)

,or freeze, B5 - power fail reset, B6 - time sync.

Then I need the value of description1 and description2, on the same column.

It is possible?

Thank you!

sql
oracle
oracle11g
asked on Stack Overflow Mar 17, 2016 by user2048092

1 Answer

1

You can combine two columns into one by using || operator.

select description1 || description2 as description from daclog where description2 is not null;

If you would like to use some substrings from each of the descriptions, you can use String functions and then combine the results. FNC(description1) || FNC(descriptions2) where FNC might be a function to return the desired substring of your columns.

answered on Stack Overflow Mar 17, 2016 by adamliesko

User contributions licensed under CC BY-SA 3.0