hi friends,
I have a table A
col as
status|NUM
and value as
open |1
open |2
close |3
close |3
the O/P should be
open|close
1 |3
2 |4

Answer Posted / ajit

select decode ( status, 'open', num ) open,
decode ( status, 'close', num ) close
from A;

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to convert times to characters in oracle?

603


Explain the use of full option in exp command.

586


How do we create privileges in oracle?

582


What is a trigger and what are its types?

612


How to define an anonymous block?

614






How to create a new user account in oracle?

574


What are group functions in oracle?

581


What are named parameters?

608


What is oracle update statement with inner join ?

577


How to use like conditions in oracle?

566


What happens if you lost a data file?

576


What is a nvl function?

559


What query tells you how much space a tablespace named test is taking up, and how much space is remaining?

1800


What is truncate oracle?

527


What is a sub query? What are its various types?

581