SQL Language (MOSC)

MOSC Banner

Decode/ Case Issue

edited Sep 21, 2010 6:37PM in SQL Language (MOSC) 7 commentsAnswered
 Hi,

I have a table A having following definition:
A_ID number
A_Name varchar
A_Prnt_ID number
A_Code varchar

I have to write a SQL statement with the following logic:

If A_Code = 'ABC' ,then query must return A_name of A_Prnt_ID, else it must return the A_name of A_ID


How do we implement this?? Neither CASE nor DECODE will work I believe.

Thanks in advance!

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center