Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

select case when oracle

SELECT
	CASE COLUMN1 WHEN 'N' THEN
		CASE COLUMN2
			WHEN 1 THEN NVL(COLUMN3,COLUMN4)
			WHEN 2 THEN NVL(COLUMN3,COLUMN4) 
			WHEN 3 THEN NVL(COLUMN3,COLUMN4) 
			WHEN 4 THEN NVL(COLUMN3,COLUMN4) 
			WHEN 5 THEN NVL(COLUMN3,COLUMN4) 
			WHEN 6 THEN NVL(COLUMN3,COLUMN4)
		ELSE COLUMN5 END 
	ELSE COLUMN6 END
FROM TABLE_NAME
Source by www.mastertraining.com.br #
 
PREVIOUS NEXT
Tagged: #select #case #oracle
ADD COMMENT
Topic
Name
7+4 =