Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Rearrange columns

Re: Rearrange columns

From: gazzag <gareth_at_jamms.org>
Date: 19 Jan 2007 02:57:13 -0800
Message-ID: <1169204233.157174.303160@q2g2000cwa.googlegroups.com>


MRCarver wrote:
> What is the preferred way for rearranging columns in Oracle 10g XE. I
> can't seem to find a way to do this..
>
>
> Regards,
>
> A Oracle Newbie
> MR Carver

Why do you want to do this? Column order is irrelevant in a RDBMS.

However, if you _really_ feel the urge to:

CREATE TABLE <new_table>
AS SELECT <column5>, <column2>, <column1>, <column4>, <column5>

      FROM <original_table>;

RENAME <original_table> TO <original_table_bak>;

RENAME <new_table> TO <original_table>;

HTH -g Received on Fri Jan 19 2007 - 04:57:13 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US