Creating a View Consisting of a Column with Static Information

I create a view like this

CREATE VIEW TEST  AS 
    (
    SELECT a.ID, a.E_ID, b.CAT1 AS C1, c.CAT1 AS C2
    FROM RECP a
    JOIN ART  b on (a.ID=b.SKU)
    JOIN ART  c on (E_ID=c.SKU)
    )

      

It works great, but I need to add two additional columns (add1, add2) with static information. It is equal for each line.

For example,

ID E_ID  C1  C2  add1 add2
1   10   a   c   NL   RS
2   20   b   b   NL   RS
3   30   c   a   NL   RS
4   40   d   d   NL   RS

      

It does not consist of other tables and is not equal for every row. How can you add these add1 and add2 columns to the view?

+3


source to share


1 answer


CREATE VIEW TEST AS 
(
    SELECT a.ID, a.E_ID, b.CAT1 as C1, c.CAT1 as C2, 'NL' AS add1, 'RS' AS add2
    FROM RECP a
    JOIN ART  b on (a.ID=b.SKU)
    JOIN ART  c on (E_ID=c.SKU)
)

      



+1


source







All Articles