regarding denormailizing the strutcture of table.

Database
Enthusiast

regarding denormailizing the strutcture of table.

    LD_SRC_ID     ACTV                  SRC                            VRSN       HGHR_SRC

1 11                     y                 Phone-Phone book              1                 1

2 14                     y       Web-Company internet pages       1                 2

3 6                       Y                       Purchased List                1                 ?

4 12                     Y                Web-Web Survey                   1                 2

5 13                     Y                   Web-Internet pages           1                 2

6 16                     Y                Inquiry-Price info (Price list)    1                3

7 17                     Y                       Referral-Customer           1                 4

8 15                     Y                    Inquiry-Product info             1                3

9 7                       Y                        Event/Tradeshow            1                ?

10 4                     Y                               Referral                     1                ?

11 19                   Y                Social Media-Facebook             1                5

12 2                     Y                                Web                         1                 ?

13 8                     Y                          Other                              1                ?

14 10                   Y                  Phone-Outbound Call             1                1

15 18                   Y                      Referral-Partner                  1                4

16 9                     Y                       Phone-Inbound Call           1                1

17 5                     Y                            Social Media                  1                 ?

18 3                     Y                          Inquiry                             1                ?

19 1

from the above table what i want in output is hghr_sc_description column,ld_scr descrption column.

the value is dereived from src column of table.

example

 src vaue("phone-phone book") then value in hghr_sc_description should be "phone" and ld_scr_id_description should be "phone book" in same way respective value tooo

can u please help me out of this with this problem?

1 REPLY
Enthusiast

Re: regarding denormailizing the strutcture of table.

Hi,

There is not a very clear patteren about the data you want to split. But if you want to split data based in -, then the following code might help.

SELECT SUBSTR(ColumnName, POSITION('-' IN SRC))  FROM TableName;
Khurram