CREATE VOLATILE TABLE SPCL_TYP(
)ON COMMIT PRESERVE ROWS
INSERT INTO SPCL_TYP VALUES(1,'INTR','PUM,NULL);
INSERT INTO SPCL_TYP VALUES(1,'INTR',NULL,NULL);
INSERT INTO SPCL_TYP VALUES(2,'CCM','PUM',NULL);
INSERT INTO SPCL_TYP VALUES(3,'DED','TRE','WRE');
NEED TO WRITE BELOW CASE
IF SPCL_TYP_C IS NOT NULL THEN 'Y'
IF SUB_SPCL_TYPE1 IS NOT NULL THEN 'N'
IF SUB_SPCL_TYPE2 IS NOT NULLTHEN 'N'
I NEED O/P LIKE THIS:-
all the not null values from the SUB_SPCL_TYPE1,2 VALUES SHOULD ME MARKE AS 'N'AND THOSE NOT NULL VALUES NEED TO PASS IN SPCL_TYPE_CODE COLUMN AS SHOWN ABOVE.
SELECT SPCL_TYP_C AS SPCL_TYPE_CODE, 'Y' AS PRE_IND_CD
WHERE SPCL_TYP_C IS NOT NULL
SELECT SUB_SPCL_TYPE1, 'N'
WHERE SUB_SPCL_TYPE1 IS NOT NULL
SELECT SUB_SPCL_TYPE2, 'N'
WHERE SUB_SPCL_TYPE2 IS NOT NULL
@THANKS FOR QUICKRESPONSE ...
I NEED ,ALL SPCL_TYPE_CODE ,SUB_SPCL_TYPE1,2 NOT NULL VALUES IIN ONE ROWS AND WITH INDICATORS IN ANOTHER ROWS AS SHOWN BELOW
DDM,Y--ONE COLUMNVALUES WITH PRE_IND_CD
TRE,N FROM SUB_SPCL_TYPE1,NOT NULLCOLUMN VALUES WITH INDICATORS COLUMNS
WRE,N FROM SUB_TYPE2,NOTNULL VALUES WITH INDICATORS COLUMN