Jump to content

If statment in select (ORACLE)


Recommended Posts

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 by forestq
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...