Let us suppose we have a table with structure in order

empno
empname
empdesig
empcountry

and now i want to re-organize the columns of this table to

empno
empdesig
empname
empcountry

how can i do this with queries ?

assume that table contains the data.

Answers were Sorted based on User's Feedback



Let us suppose we have a table with structure in order empno empname empdesig empcountry an..

Answer / jyothi

there is only one way to to re-arrange the table
that is views...

create view <view-name>as select <fields> from <tablename>
.........
for example..
create view vw as select empno,empdesig,empname,empcountry
from <tablename>...
(u can get message that is view created)
just display the data using viewname(vw)..

Is This Answer Correct ?    2 Yes 0 No

Let us suppose we have a table with structure in order empno empname empdesig empcountry an..

Answer / s. syam sundar

try this

create table emp1 as select
empno,empdesig,empname,empcountry from emp


this would creat a new table named as emp1 and
u can retrive the data from this table as of emp
but constraints,indexs which u have on emp table are
created on this emp1 table

Is This Answer Correct ?    0 Yes 0 No

Let us suppose we have a table with structure in order empno empname empdesig empcountry an..

Answer / bala

try updating the values for COLUMN_ID in the
ALL_TAB_COLUMNS table..using Admin Privilege. to update
this table...

Is This Answer Correct ?    1 Yes 2 No

Post New Answer

More SQL PLSQL Interview Questions

how mysql optimizes distinct? : Sql dba

0 Answers  


What can sql server reporting services do?

0 Answers  


What does cursor do in sql?

0 Answers  


How do I save a stored procedure?

0 Answers  


What cursor type do you use to retrieve multiple recordsets?

17 Answers   Apollo, CTS, IonIdea, Microsoft, Oracle, TCS, Vmoksha, Wipro,






what is 'mysqldump'? : Sql dba

0 Answers  


I m giving Source, Destination and Age. Write a procedure or function, it will give to u this source to destination tickets are available or not, if available then check this person is senior citizen or not,if this person is senior citizen then give some discount. PLZ give this answer...... Thanks advance.....

3 Answers  


How many indexes can be created on a table in sql?

0 Answers  


How does a self join work?

0 Answers  


What does “select count(1) from tab” result?

10 Answers   IBM,


How to return multiple rows from the stored procedure?

0 Answers  


Do foreign keys improve performance?

0 Answers  


Categories