Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- set pages 10000
- select distinct SUBSTR(c.cust_income_level, 1, INSTR(c.cust_income_level, ':', 1, 1)-1) INCOME_ID
- (CASE INSTR(c.cust_income_level, 'Below')
- when 4 then 0
- else
- case instr(c.cust_income_level, 'and above')
- when 0 then
- to_number(trim(SUBSTR(c.cust_income_level, INSTR(c.cust_income_level, ':', 1, 1)+1, INSTR(c.cust_income_level, '-', 1, 1)-3)), '999.999')
- else
- to_number(trim(SUBSTR(c.cust_income_level, INSTR(c.cust_income_level, ':', 1, 1)+1, INSTR(c.cust_income_level, 'and', 1, 1)-3)), '999.999')
- end
- end)LIM_INF,
- FROM customers c WHERE country_id = 'US' and c.cust_income_level IS NOT NULL
- ORDER BY INCOME_ID;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement