Query Help

Query Help

 

  

I am trying to do the following in a query.

When I query the status from the job_runs table it displays the status
in code format. But I want to display it in text format. There is a
table (intcodes) that defines what the codes equal. How do I tie the 2
tables together to display the status in text form not in code form
within the query.

SQL> select status
2 from job_runs;

STATUS
----------
4
4
4
4
4
4
4
4
4
4

SQL> select *
2 from intcodes;


FLD CODE TEXT
------------------------------ ---------- -----------
status 0
status 1 RUNNING
status 3 STARTING
status 4 SUCCESS
status 5 FAILURE
status 6 TERMINATED
status 7 ON_ICE
status 8 INACTIVE
status 9 ACTIVATED
status 10 RESTART
status 11 ON_HOLD

Oracle LazyDBA home page