0

I have this view with following definition.

create view VIEW_IRS1 as Select 
MBR.PRSN_MBRSH_ID
, Atr.Ssn_Tx
, Names.First_Na
, Names.Middle_Na
, Names.Last_Na
, Reff.Ref_Cd_Desc_Tx Suffix_Na
,'FALSE' AS [Request Title II Monthly Income Verification]

From Hix.T_Enrt En 
Inner Join Hix.T_Prsn_Enrt Pe On En.Enrt_Id = Pe.Enrt_Id And En.Enrt_Status_Cd In (428,439, 430 ) And Pe.Active_In = 'Y' And (Pe.Retro_In Is Null Or Pe.Retro_In = 'N') 

Left Outer Join Hix.T_Aptc Ap On En.Enrt_Id = Ap.Enrt_Id

Left Outer Join Hix.T_Prsn_Addl_Attr Atr On Pe.Prsn_Mbrsh_Id = Atr.Prsn_Mbrsh_Id

Left Outer Join
(                   
    Select nAc.Prsn_mbrsh_Id,  First_Na , Middle_Na , Last_Na, Suffix_Cd From Hix.T_Prsn_Name Na, Hix.t_prsn_mbrsh_prsn_name_ac nAc
    where na.prsn_name_id = nAc.prsn_Name_Id
) Names On Pe.prsn_mbrsh_id = Names.prsn_mbrsh_id

Left Outer Join Hix.T_Ref_Data Reff On Names.Suffix_Cd = Reff.Ref_Data_Id

Left Outer Join Hix.T_Ref_Data Re On Atr.GENDER_CD = Reff.Ref_Data_Id

Left Outer Join Hix.T_PRSN_MBRSH MBR on MBR.PRSN_MBRSH_ID=Pe.PRSN_ENRT_ID;

I want to create a new view (not alter this view) with an additional column name say "ABC" whose value should always be FALSE. How can I do that?

1
  • 2
    Which DBMS are you using? Postgres? Oracle?
    – user1822
    May 21, 2014 at 15:35

1 Answer 1

2

Can you not just create a new view that is

SELECT *, 0 AS "ABC"
FROM VIEW_IRS1 

Or if you mean the text 'False'

SELECT *, 'FALSE' AS "ABC"
FROM VIEW_IRS1 

Or to edit the existing view:

SELECT 
    MBR.PRSN_MBRSH_ID
    , Atr.Ssn_Tx
    , Names.First_Na
    , Names.Middle_Na
    , Names.Last_Na
    , Reff.Ref_Cd_Desc_Tx Suffix_Na
    , 'FALSE' AS "My Really Long Name"
FROM 
    AllYourOtherTables
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.