With the SQL statement below
I can add a new column under select with
COMP.PIPETYPE AS PAC_NO,
But how do I change the values in this new column?
Can I use if-then statements / If PAC_NO = 'DI' then PAC_NO = '1234'
/*
SewerServiceLine
*/
SELECT COMP.*,
VAR.*,
UNITTYPE.PDESCRIPT] AS UNITTYPE_RESOLVED,
ADDRKEY.KCACITY],
ADDRKEY.KCAPOSTDIR],
ADDRKEY.KCAPROVINCE],
ADDRKEY.KCASTNAME],
ADDRKEY.KCASTNO],
ADDRKEY.KCASUFFIX],
STKEY.KDESCRIPT] AS SEGKEY_RESOLVED,
AREA.ADESCRIPT] AS AREA_RESOLVED,
SUBAREA.ADESCRIPT] AS SUBAREA_RESOLVED,
DISTRICT.RDESCRIPT] AS DISTRICT_RESOLVED,
LOC.>DESCRIPT] AS LOC_RESOLVED,
PIPETYPE.EDESCRIPT] AS PIPETYPE_RESOLVED,
SURF.>DESCRIPT] AS SURF_RESOLVED,
SIC.pDESCRIPT] AS SIC_RESOLVED,
SRVTYPE.VDESCRIPT] AS SRVTYPE_RESOLVED,
MFGKEY.MCODE] AS MFGKEY_RESOLVED,
SERVSTAT.EDESCRIPT] AS SEVRSTAT_RESOLVED,
OWN.>DESCRIPT] AS OWN_RESOLVED
FROM ASSETMANAGEMENT_SEWER.NCOMPSSL] AS COMP
LEFT JOIN BURNABY. VARSSL] AS VAR ON COMP. COMPKEY] = VAR.YCOMPKEY]
LEFT JOIN ASSETMANAGEMENT_SEWER.NSEWERSERVICETYPE] AS UNITTYPE ON COMP. UNITTYPE] = UNITTYPE.UCODE]
LEFT JOIN PROPERTY. ADDRESS] AS ADDRKEY ON COMP.YADDRKEY] = ADDRKEY.=ADDRKEY]
LEFT JOIN ASSETMANAGEMENT_STREET.NCOMPSEG] AS COMPSEG ON COMP.GSEGKEY] = COMPSEG.=COMPKEY]
LEFT JOIN ASSETMANAGEMENT_STREET.NSTREET] AS STKEY ON COMPSEG.NSTKEY] = STKEY.]STKEY]
LEFT JOIN ASSETMANAGEMENT_SEWER.MSEWERAREA] AS AREA ON COMP.EAREA] = AREA.ECODE]
LEFT JOIN ASSETMANAGEMENT_SEWER.MSEWERSUBAREA] AS SUBAREA ON COMP.ESUBAREA] = SUBAREA. CODE]
LEFT JOIN ASSETMANAGEMENT_SEWER.MSEWERDISTRICT] AS DISTRICT ON COMP.CDISTRICT] = DISTRICT.=CODE]
LEFT JOIN ASSETMANAGEMENT_SEWER.MSEWERLOCATION] AS LOC ON COMP.OLOC] = LOC.LCODE]
LEFT JOIN ASSETMANAGEMENT_SEWER.ESEWERPIPETYPE] AS PIPETYPE ON COMP.YPIPETYPE] = PIPETYPE. CODE]
LEFT JOIN ASSETMANAGEMENT_SEWER.ESEWERSIC] AS SIC ON COMP.SSIC] = SIC.[code]
LEFT JOIN ASSETMANAGEMENT_SEWER.ESEWERSERVICETYPE] AS SRVTYPE ON COMP.YSRVTYPE] = SRVTYPE.]CODE]
LEFT JOIN ASSETMANAGEMENT_SEWER.ESEWERSURFACECOVER] AS SURF ON COMP.USURF] = SURF.UCODE]
LEFT JOIN RESOURCES.IMFG] AS MFGKEY ON COMP.GMFGKEY] = MFGKEY.EMFGKEY]
LEFT JOIN ASSETMANAGEMENT_SEWER.ASEWERSERVICESTATUS] AS SERVSTAT ON COMP.VSERVSTAT] = SERVSTAT.TCODE]
LEFT JOIN ASSETMANAGEMENT_SEWER.ASEWEROWNERSHIP] AS OWN ON COMP.SOWN] = OWN.PCODE]
WHERE COMP.>COMPKEY] > 1