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.

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can we solve sql error: ora-00904: invalid identifier?

706


how mysql optimizes distinct? : Sql dba

561


What are the differences between implicit and explicit cursors?

530


List the ways to get the count of records in a table?

518


Why is stored procedure faster than query?

502






Why use subqueries instead of joins?

613


How do I run sql?

628


Does pl sql work in mysql?

544


What is serial sql?

539


Is sql better than excel?

527


what is the difference between undefined value and null value? : Sql dba

575


How do you determine the current isolation level? : Transact sql

586


how do you control the max size of a heap table? : Sql dba

552


What is pl/sql table? Why it is used?

573


Can we rename a column in the output of sql query?

551