How to remove some columns of an existing table?

Let's say my table structure is as follows:

Name of the table: EMPLOYEE
Columns: Name, date of birth, sex, salary, birthplace, language and so on.

There are data in the table. Now, I want to delete some columns, hometown and the language, and I don't like the loss of data. In addition, there is no constraint.
What is the sql command to do this? Thank you!

Name of the table: EMPLOYEE
Columns: Name, date of birth, sex, salary, birthplace, language and so on.

MHO%xe> desc employee
 Naam                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 NAME                                               VARCHAR2(30)
 BIRTHDATE                                          DATE
 GENDER                                             VARCHAR2(1)
 SALARY                                             NUMBER
 HOMETOWN                                           VARCHAR2(255)
 LANGUAGE                                           VARCHAR2(30)

MHO%xe> alter table employee
  2  drop column hometown;

Tabel is gewijzigd.

Verstreken: 00:00:07.28
MHO%xe> alter table employee
  2  drop column language;

Tabel is gewijzigd.

Verstreken: 00:00:00.15
MHO%xe> desc employee
 Naam                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 NAME                                               VARCHAR2(30)
 BIRTHDATE                                          DATE
 GENDER                                             VARCHAR2(1)
 SALARY                                             NUMBER

Also say what version you have turned on, if it does not work ;)

Tags: Database

Similar Questions

  • How to remove some unusual applications of my apple ID

    How to remove some unusual applications of my apple ID

    I don't know what you mean by unusual apps, but you cannot delete apps from your purchase history at all. All purchases are for always connected to your Apple ID and cannot be deleted.  You can hide and expose the purchases.

    Hide and expose the iTunes Store, App Store or purchases made on iBooks Store - Apple Support

    If you want to remove third-party applications not used, press on the icon of the app until it wiggles and then tap the X in the corner of the icon. When you are finished, press the home button. You can also go into settings > general > storage & use iCloud > storage > storage management. Let the list of load applications. Tap the one you want to delete and delete on the next screen.

    You can not remove the preinstalled applications.

  • How to remove a column from a table in a dell identtiymananger 7.0

    How to remove a column from a table in a dell identtiymananger 7.0

    Hello

    In Version 7 of the removal of a single custom column can be accomplished by a stored procedure, available in the database called: QBM_PColumnDrop

    Hope that helps.

    Cordially Fatih

  • How to remove a line empty in a table

    How to remove a line empty in a table?
    This is how to remove only a line including all columns as null values...
    Please help me

    Sounds strange, but you can use COALESCE to achieve this.

    ME_XE?create table all_nullz (col1 number, col2 number, col3 number);
    
    Table created.
    
    Elapsed: 00:00:00.20ME_XE?ME_XE?insert into all_nullz values (1,2,3);
    
    1 row created.
    
    Elapsed: 00:00:00.12ME_XE?insert into all_nullz values (null, null, null);
    
    1 row created.
    
    Elapsed: 00:00:00.06ME_XE?ME_XE?delete from all_nullz where coalesce(col1,col2,col3) is null;
    
    1 row deleted.
    
    Elapsed: 00:00:00.26ME_XE?
    
  • I can add a column to an existing table with the data.

    Hello

    I'm working on
    The Version of database: Oracle 9i

    I can add a column to an existing table that already has data with below given command.

    ALTER TABLE table_name
    ADD the definition of the column_name column;

    Kind regards
    John

    Add to that:

    If your new column is NOT "null", you need the task in 3 steps:

    1. Add the column without a NOT NULL constraint
    2. the default value of the new column added.
    3. Add the NOT NULL constraint in the new column.

    concerning
    AJ

  • How to remove some footage of a player of "my Passport"?

    I downloaded some footage from a P2 card to an external drive "my passport" and now you want to remove some.  How to do this is to first pro or premiere pro?

    First, you can make offline then check Media files are deleted.

  • How to remove some downloaded files?

    Hello
    I have the screen of data entry in which users enter all mandatory values and download support files.
    I have created a temporary 'TEMP' table to track details of downloaded file, and then view these downloaded files
    I've created a report with the following query:

    SELECT a.file_id, a.file_name, a.file_desc
    OF APEX_APPLICATION_FILES a, b TEMP
    WHERE b.name = b.SID
    AND b.entry_id =: P341_ENTRY_ID;

    I have converted the first column of the query as a link.

    with this I am able to display all downloaded files and passing the url in file id in the query, I am able to download all the files.

    How to remove selective files in this report? say if I have 5 files I want to remove the 1st third and one?

    I need to create link for each line in this similar to file_id report or
    do I have to use the link in the column or
    I create checkbox next to each line?

    Thank you
    Manoi.

    Guillot:

    You can create a 'tabular form' based on your query. The tabular form wizard allows the operation of 'Remove' against the lines selected according to the report.

    http://download.Oracle.com/docs/CD/E14373_01/AppDev.32/e13363/frm_tabular.htm#CHDFBHDB

    CITY

  • How to remove some archivers without a catalag

    I read in the doc that we need a catalog to manage a backup of data protection. We don't yet have it.

    How to remove archivers of FRA of primary and emergency in order to free up space of the FRA?

    Published by: usersp on April 4, 2012 17:08

    Hello;

    I would still use RMAN to delete without the catalog.

    echo "Starting RMAN..."
    $ORACLE_HOME/bin/rman TARGET SYS/oracle@trgt NOCATALOG << EOF
    
    delete noprompt ARCHIVELOG UNTIL TIME 'SYSDATE-8';
    
    exit
    EOF
    

    Best regards

    mseberg

  • Adding a sequential number column to an existing table.

    Greetings.

    I have an existing table of some 30 million lines.

    I would like to add an additional column (I did).

    I want to fill this new column with a sequential number.

    Have tried to create a sequence, I am at a loss on how to trigger the filling of the column.

    Any help would be received with gratitude.

    Thank you

    Published by: 896596 on May 16, 2012 09:05

    896596 wrote:
    Greetings.

    I have an existing table of some 30 million lines.

    I would like to add an additional column (I did).

    I want to fill this new column with a sequential number.

    Have tried to create a sequence, I am at a loss on how to trigger the filling of the column.

    Any help would be received with gratitude.

    Thank you

    Published by: 896596 on May 16, 2012 09:05

    Update new_col is set nextval.seq1;.

  • How to remove select data in the control table

    This problem makes me headache.

    I'm new to labview, when data in a table. a lot of lines and columns. How can remove on the line that I chose. the other lines are remain unchanged.

    I really need help.thanks in advance. It is best to attach the labview program.my is 2009

    That kind of thing does not work with the table that's why I suggested to go for the multicolumn list box. You can do simple.

    Good luck

  • Oracle BPM 12.2.1 workspace how to add additional columns to the DB table tasklist

    Hi all

    I need to add some required columns to the table from the list of tasks (for example, activity and status of the activity referred to in the task line), I decompiled adflibTaskListTaskflow.jar and found a class named TaskModel.class in this package: oracle.bpel.worklistapp.tasklist.beans.model, if decompile you this class, you can see that at the table from the list of tasks, data are expressed here by using ITaskQueryService now how more columns may add other tables or is there another easier solution?

    Hi Hadi,

    You can add columns to your table of task list in the workspace by changing the current view, or even create a new (more and icons in pencil). The situation of activity is available in the list of columns.

    You can also add columns to the list view based on flexfields tasks that you create.

    If you manually change the adflibTaskListTaskflow.jar you can have problems in the future given that libraries can change between versions and of course are not recommended to do.

    I have add columns to the list of tasks, and at that time here, we have created a list of custom task based on BPM Middleware. If you follow this method, you will have complete freedom to show what you want.

  • Remove the column from the compressed tables

    NLSRTL11.2.0.3.0Production
    Oracle Database 11g Enterprise Edition11.2.0.3.064 bit Production
    PL/SQL11.2.0.3.0Production
    AMT for Linux:11.2.0.3.0Production

    Hello

    I read on how to do to remove a compressed table column - first set unused and then drop unused columns. However, in the example below on the basis of data, I ran it, it does not work. Please, can you tell me WHEN this approach does not work. What is dependent on - settings or something else. Why can't I drop unused columns?

    And the example and errors:

    create table tcompressed compress in select * from all_users;

    > TCOMPRESSED table created.

    ALTER table tcompressed add x number;

    > table TCOMPRESSED altered.

    ALTER table tcompressed drop the x column;

    >

    Error report:

    SQL error: ORA-39726: unsupported operation column add/drag on compressed tables

    39726 00000 - "operation column add/drop not supported on compressed tables. ''

    * Cause: Not support add/column operation move compressed tables

    elapse.

    * Action: When adding a column, do not specify a default value.

    DELETE column is only supported in a column SET UNUSED

    (remove the column metadata).

    ALTER table tcompressed unused column of the set x;

    > table TCOMPRESSED altered.

    ALTER table tcompressed drop unused columns;

    >

    Error report:

    SQL error: ORA-39726: unsupported operation column add/drag on compressed tables

    39726 00000 - "operation column add/drop not supported on compressed tables. ''

    * Cause: Not support add/column operation move compressed tables

    elapse.

    * Action: When adding a column, do not specify a default value.

    DELETE column is only supported in a column SET UNUSED

    (remove the column metadata).

    As you can see even after changing the table defining the column as unused X I still can't drop by DROP UNUSED COLUMNS.

    Thank you.

    If you enable compression for all operations on a table, you can delete the columns in the table. If you enable compression for the only direct-path inserts, you can't remove columns.

  • Add the column to an existing table-based user-defined type

    Hello guys,.
    I am compiling my function that returns a type defined by the user based on an existing table. Throughout the process of initialization so my query returns an additional column - SCORE (1). Here is my package:

    create or replace
    PACKAGE STAFF_AGENCY_PKG AS

    TYPE TYPE_SEEKER_TABLE IS TABLE OF THE DRAW. SEEKER % ROWTYPE;
    FUNCTION GET_SEEKERS (IN_KEYWORD IN VARCHAR2)
    TYPE_SEEKER_TABLE RETURN PIPELINE;

    END STAFF_AGENCY_PKG;
    -------

    create or replace
    STAFF_AGENCY_PKG PACKAGE BODY
    AS

    FUNCTION GET_SEEKERS (IN_KEYWORD IN VARCHAR2)
    TYPE_SEEKER_TABLE RETURN PIPELINE
    IS
    R_TBL TYPE_SEEKER_TABLE; -to return
    BEGIN
    FOR R IN)
    SELECT Seeker.SEEKER_ID,
    Seeker.FIRSTNAME,
    Seeker.LASTNAME,
    Seeker.NATIONALITY,
    Seeker.ISELIGIBLE,
    Seeker.BIRTHDATE,
    Seeker.ISRECIEVEEMAILS,
    Seeker.HIGHESTDEGREE,
    Seeker.ETHNICITY,
    Seeker.GENDER,
    Seeker.ISDISABILITY,
    Seeker.DISABILITY,
    Seeker.CV,
    Seeker.PASSWORD,
    Seeker.PREFFERED_CITY,
    SEEKER. E-mail
    SEEKER. JOB_PREFERENCES_ID,
    SCORE (1)
    THE APPLICANT Seeker
    WHERE CONTAINS (CV, ' < query >)
    < textquery lang 'grammar' = 'context' = > ' |
    GET_RELATED_CATEGORIES (IN_KEYWORD) |
    ' < / textquery >
    < score datatype = "INTEGER" / >
    (< / query > ', 1) > 0
    )
    LOOP
    PIPE ROW (R); -Error (38,10): PLS-00382: expression is of the wrong type
    END LOOP;
    RETURN;

    END GET_SEEKERS;
    END STAFF_AGENCY_PKG;

    How do I change my user type to be sufficient?

    Oracle version 11.2.0.1.0
    Thanks in advance!

    >
    How do I change my user type to be sufficient?
    >
    You will need to create two new TYPEs. The one who has all the columns of the draw. The REQUESTOR table and the new column SCORE, then a TYPE which is an array of the first type.

    See example 12-22 using a Pipelined Table function for a Transformation in the PL/SQl language reference

    http://docs.Oracle.com/CD/B28359_01/AppDev.111/b28370/tuning.htm#i53120

    Here's the first part

    -- Define the ref cursor types and function
    CREATE OR REPLACE PACKAGE refcur_pkg IS
      TYPE refcur_t IS REF CURSOR RETURN employees%ROWTYPE;
      TYPE outrec_typ IS RECORD (
        var_num    NUMBER(6),
        var_char1  VARCHAR2(30),
        var_char2  VARCHAR2(30));
      TYPE outrecset IS TABLE OF outrec_typ;
     FUNCTION f_trans(p refcur_t)
          RETURN outrecset PIPELINED;
    END refcur_pkg;
    /
    
    CREATE OR REPLACE PACKAGE BODY refcur_pkg IS
      FUNCTION f_trans(p refcur_t)
       RETURN outrecset PIPELINED IS
        out_rec outrec_typ;
        in_rec  p%ROWTYPE;
      BEGIN
    

    Change

      TYPE outrec_typ IS RECORD (
        var_num    NUMBER(6),
        var_char1  VARCHAR2(30),
        var_char2  VARCHAR2(30));
      TYPE outrecset IS TABLE OF outrec_typ;
    

    to include all the columns you need. Unfortunately, you have to manually list all the columns in the draw. The REQUESTOR table. If you think you need this same structure in other places you must create them as SQL types instead of PL/SQL types.

    This example should be enough to show you how to modify your code to do something similar.

  • inserting data in a column in an existing table

    Hi the gems...

    I have an existing table TABLE_1 which has more data in it. This table has no primary key. now, I added a new column 'ID' and want to make it a primary key for this table. currently it is not allowed because the column is null...

    so I need to insert data into the column.
    now, my plan is to fill the column with the data as well as rownumber.

    means that if there are 15 records in this table, then the 'ID' column should contain data from 1 to 15. After that, I'll do the column as a primary key...

    the script I wrote for this:

    declare
    number of v_rownum;

    Start
    Select max (rownum) in the v_rownum from TABLE_1;
    because me in 1.v_rownum
    loop
    Update t set i = t.id TABLE_1 where rownum = i;
    commit;
    end loop;

    end;



    but it refreshes only the first record and the rest of the records are not updated.

    Please help... Thanks in advance...

    Select max (rownum) in the v_rownum from TABLE_1;

    How many rows do you think that this query will retrieve?

    Why not just

    Update TABLE_1 t
    the value t.id = rownum;

  • Remove/hide column in a specific table header(1st row)

    Hi, is it possible and how to remove/hide header(1st row) column in a specific table?

    Thank you!

    Go to the tab results-> change Table-> Table View Properties display-> select 'no table or column heading' under 'display column and Table topics - click OK.

Maybe you are looking for

  • Where did the option go to folder for downloads! Frustration! : ()

    Where do go to download the file from the downloads option! Frustration! : () The new downloads thing sucks! Also how do I downloads to display automatically with the new system during a download? I speak of course of the downloads window that has re

  • Satellite A300 - cannot read the second HARD drive

    Greetings from the Spain, I got 1 month there is a serious problem with my laptop (which is 5 months old), associated with crcdisk.sys. I gave up after several hours studying, and send the computer serving techniques. (Vista was does not load and no

  • How can I make an invisible control?

    I asked where the front panel is black, most of the controls are invisible.  The task is a task 'by pushing the button' - a button on the screen, and the subject is tap it (if it is green) or press no (if it is red).  I would like to place an 'invisi

  • Touchsmarrt Tx2 turns on but does not start.

    The laptop turns on I hear the fan, the caps lock and a lock of numbers blink, but it does not start. I'm runnin windows 7 Home premium. I did recent changes. Just put computer in mode 'sleep' and he won't wake up. The wireless light is orange.

  • After the removal of viruses, I have no internet access. Only "absorbing IP" or "renewal IP", nothing els.

    I have windows XP, I had to remove a virus from the Dell XPS. After that, I can't connect to the internet. Either with a wireless connection to the router or a straight cable to the router. All I have is that I can't renew or obtain an IP address. I