Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2003
    Location
    Toronto, Ontario, Canada
    Posts
    34

    Question Unanswered: deleting column data

    Hi

    Is it possible to delete the data found in a column instead of deleting the entire row?
    For example if I have a table with 3 columns (column A, column B, and column C) is it possible to only delete the data in column C leaving the data in column A and column B intact.

    Thanks

    Hamza

  2. #2
    Join Date
    May 2003
    Posts
    87

    Re: deleting column data

    Yes, it is very much possible. But deleting the data would be updating the column value with null.

    The below sql stmt would delete the salary data in the emp table i.e. update the current salary for all the employees with null salary. Note, null is not equal to 0 in Oracle.

    sql> update emp set salary=null;


    Originally posted by hally
    Hi

    Is it possible to delete the data found in a column instead of deleting the entire row?
    For example if I have a table with 3 columns (column A, column B, and column C) is it possible to only delete the data in column C leaving the data in column A and column B intact.

    Thanks

    Hamza

  3. #3
    Join Date
    Feb 2003
    Location
    Toronto, Ontario, Canada
    Posts
    34

    Re: deleting column data

    Thanks. I was thinking of something much more complicated but I guess good things come in small packages.

    Originally posted by dbmadcap
    Yes, it is very much possible. But deleting the data would be updating the column value with null.

    The below sql stmt would delete the salary data in the emp table i.e. update the current salary for all the employees with null salary. Note, null is not equal to 0 in Oracle.

    sql> update emp set salary=null;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •