forestq Posted March 25, 2013 Share Posted March 25, 2013 (edited) Hi I have simply select and works great: select 'CARAT Issue Open' issue_comment, i.issue_id, i.issue_status, i.issue_title, i.ISSUE_summary ,i.issue_description, i.severity,gcrs.Area_name, gcrs.sector_name,substr(gcrs.stream_name,1,case when instr(gcrs.stream_name,' (')=0 then 100 else instr(gcrs.stream_name,' (')-1 end) ISSUE_DIVISION,case when gcrs.STREAM_NAME like 'NON-GT%' THEN 'NON-GT' ELSE gcrs.STREAM_NAME END as ISSUE_DIVISION_2from table(f_carat_issues_as_of('31/MAR/2013')) iinner join v_gcrs_with_stream gcrs on i.segment_id = gcrs.segment_idwhere UPPER(ISSUE_STATUS) like '%OPEN%' Now I want to callte two columns: ISSUE_DIVISION and ISSUE_DIVISION_2 if they are equal in new columns should be value 1 if are not equal should be 0, how can I do it ? Edited March 25, 2013 by forestq Link to comment Share on other sites More sharing options...
justsomeguy Posted March 25, 2013 Share Posted March 25, 2013 You can use a case statement like you're already using, or you can cast (ISSUE_DIVISION == ISSUE_DIVISION_2) as an integer. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now