Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

I have a table emp. There is only one column in the table.
In that , there are only three rows in that column.
The value in the first row is 'A' and the value in the
second row is 'B' and the third row is 'C'. Now, my question
is ,

How will you write a select query to display the output as
B
C
A

Note: order by cannot be used coz it gives us output as CBA.
But the output should be BCA.

Answer Posted / garv

SELECT DECODE (EEE,'A','B','B','C','A') EEE
FROM EMP

--EEE IS COLUMN NAME OF TABLE EMP

Is This Answer Correct ?    9 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a server parameter file in oracle?

1034


What are the benefits of ordbms?

1065


How to define an external table with a text file?

1045


How to use subqueries in the from clause in oracle?

1088


Using the relations and the rules set out in the notes under each relation, write statements to create the two sequence generators specified in the notes.

2089


How to handle a single quote in oracle sql?

1012


How do I manually create a database in oracle?

994


What are the system predefined user roles?

1025


How to create an initialization parameter file?

1022


Can select statements be used on views in oracle?

1015


material view and view disadvantages?

1047


query optmization techniques and quwry analyser+projects+ppts

2402


How to bring a tablespace online?

1057


Explain the features of oracle?

1020


What is a data dictionary and how can it be created?

1115