Page 1 of 3 123 LastLast
Results 1 to 10 of 26
  1. #1

    Cool adding new column in TABLE using sql


    hi all

    i have follow some tutorial lessons in sql and i arrived in a stage when my curiosity invigorates my enthusiasms to farther hone my skills but not just practicing but also inquiring


    in the table i created (which i name PRACTICE_SQL101) ... i want to add a column between an already existing 2-columns


    how can i possibly do it [i want it to be between the column City and Country to be names as Zip Code] ... what sort of commands or syntax in sql will i use then?

    likewise, i want the Zip Code to accept only numbers only


    the header of my table looks like this:


    P_Id LName FName Address City Country


    thanks a lot of any valuable suggestions


    cheers!

  2. #2
    I am not sure if pwede mu add in between existing columns..
    maypa i modify nalng ang column to the new one then add it again

  3. #3
    recreate the table..

  4. #4
    Quote Originally Posted by digitalsuperman View Post
    recreate the table..
    mao ni pinakadali nga solution...

  5. #5
    try using the ALTER TABLE command
    Spoiler: try this 

    ALTER TABLE <table name> ADD <column name> <data type>(length) AFTER <column name>;
    Last edited by ChaosOrb; 12-08-2008 at 03:44 AM.

  6. #6
    Quote Originally Posted by anggwaponi View Post
    hi all

    i have follow some tutorial lessons in sql and i arrived in a stage when my curiosity invigorates my enthusiasms to farther hone my skills but not just practicing but also inquiring


    in the table i created (which i name PRACTICE_SQL101) ... i want to add a column between an already existing 2-columns


    how can i possibly do it [i want it to be between the column City and Country to be names as Zip Code] ... what sort of commands or syntax in sql will i use then?

    likewise, i want the Zip Code to accept only numbers only


    the header of my table looks like this:


    P_Id LName FName Address City Country


    thanks a lot of any valuable suggestions


    cheers!

    --RECREATE THE TABLE and here's the simple script that might help you.

    drop table PRACTICE_SQL101;

    create table PRACTICE_SQL101
    (
    P_ID NUMBER(10) NOT NULL,
    LNAME VARCHAR2(15),
    FNAME VARCHAR2(15),
    CITY VARCHAR2(10),
    ZIP_CODE NUMBER(10),
    COUNTRY VARCHAR2(10)
    );

  7. #7
    you can simply alter table then column name after column name

  8. #8
    hay naku, gusto jud ug pahungit sa solutions oi, naay ALTER TABLE command, mag.recreate pa jud sa TABLE. Basa pud intawn mo ug manual oi.

  9. #9
    ^^
    hehehe
    kalma lang gud, nahan na sila ug lisod.
    Ok na ang ALTER kay wla ka kabalo if naa nba data ang table
    And considering also the foreign key references.

  10. #10
    Quote Originally Posted by ChaosOrb View Post
    hay naku, gusto jud ug pahungit sa solutions oi, naay ALTER TABLE command, mag.recreate pa jud sa TABLE. Basa pud intawn mo ug manual oi.
    i think we all know DDL and how to use DDL but the thread starter wants to know any work around and please read the post clearly. if you think we are not reading, you're definitely wrong, i even spend my whole life for my career and this made me very profitable. i hope i made myself very very clear.

  11.    Advertisement

Page 1 of 3 123 LastLast

Similar Threads

 
  1. Hot New EVENT in CEBU
    By khaos_stalker in forum Parties & Events
    Replies: 1
    Last Post: 08-26-2015, 09:46 PM
  2. For Sale: hp mini 110-3700 NEW - week in use 15k
    By johndesc in forum Computers & Accessories
    Replies: 1
    Last Post: 07-30-2011, 11:19 PM
  3. new bigs in mactan
    By jonz in forum Business, Finance & Economics Discussions
    Replies: 81
    Last Post: 10-11-2009, 08:38 PM
  4. New Tapsilogan in Opon
    By vudz in forum Food & Dining
    Replies: 11
    Last Post: 02-06-2009, 04:13 PM
  5. HOW TO CONNECT SQL SERVER USING SQL AUTHENTICATION
    By edshark in forum Software & Games (Old)
    Replies: 13
    Last Post: 09-02-2005, 04:53 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top