Create Table Syntax

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Shrutisinha
    New Member
    • Feb 2007
    • 25

    Create Table Syntax

    Hi Guys
    Really need your help I donno what I am doing wrong in here
    Want to create a table with another existing table
    Here is the syntax I am using

    create table pctemp1
    As
    (SELECT distinct a.Promo,b.Ban,b .[Ban Status],
    b.[BAn Statys Reson Code],b.[Last Ban Status Date]
    FROM PC_FUSION_07042 4 a
    LEFT OUTER JOIN ARCL05_070423 b
    ON a.BAN = b.BAN
    WHERE b.BAN is not null )

    and it says Syntax error with AS clause, tried removing AS clause but no go , can anybody help me please ...

    thanks
    Last edited by Shrutisinha; May 2 '07, 12:31 PM. Reason: add the sgnature
  • kabilahan
    New Member
    • May 2007
    • 14

    #2
    select * into NEW TABLE NAME from OLD TABLE NAME--
    THIS IS THE SYTAX..YOU CAN USE THIS FOR UR NEED

    Comment

    • kabilahan
      New Member
      • May 2007
      • 14

      #3
      SELECT distinct a.Promo,b.Ban,b .[Ban Status],
      b.[BAn Statys Reson Code],b.[Last Ban Status Date] INTO NEW_TABLE_NAME
      FROM PC_FUSION_07042 4 a
      LEFT OUTER JOIN ARCL05_070423 b
      ON a.BAN = b.BAN
      WHERE b.BAN is not null

      TRY THIS...

      Comment

      Working...