How to create a table from existed table.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Gison
    New Member
    • Oct 2007
    • 6

    How to create a table from existed table.

    I try to create a table from another existed table but always error.
    Please help, does any one know what's wrong in my sentence?

    =======
    create table item_bak
    as (select * from item);
    =======

    thanks a lot.
    gison
  • iburyak
    Recognized Expert Top Contributor
    • Nov 2006
    • 1016

    #2
    Try this:

    Code:
    select * into item_bak from item

    Good Luck.

    Comment

    • ck9663
      Recognized Expert Specialist
      • Jun 2007
      • 2878

      #3
      Originally posted by Gison
      I try to create a table from another existed table but always error.
      Please help, does any one know what's wrong in my sentence?

      =======
      create table item_bak
      as (select * from item);
      =======

      thanks a lot.
      gison
      if you want to create item_bak based on item's structure, EXCLUDING the data, you go:

      select * into item_bak from item where 1 = 2

      Comment

      • Gison
        New Member
        • Oct 2007
        • 6

        #4
        Thanks iburyak and ck9663 a lot.
        I can be done.

        :)

        Comment

        Working...