Title: RE: SQL question

update <table_name> set id = substr(id,-4);

eg:
[EMAIL PROTECTED]> select substr('48900322',-4) from dual;

SUBS
----
0322

1 row selected.

Nirmal.

    -----Original Message-----
    From:   Malik, Fawzia [SMTP:[EMAIL PROTECTED]]
    Sent:   Wednesday, November 21, 2001 7:04 PM
    To:     Multiple recipients of list ORACLE-L
    Subject:        SQL question


    Hi,

    Can you tell me if its possible to write some sql to change some data.
    Basically I need to run a scritp to change data of column: id from 12345678
    to the last four digits. Is this possible to do in sql/plsql??

    Any advice/hints would be greatly appreciated

    Rgds

    Fawzia


    **********************************************************************
    Information in this email is confidential and may be privileged.
    It is intended for the addressee only. If you have received it in error,
    please notify the sender immediately and delete it from your system.
    You should not otherwise copy it, retransmit it or use or disclose its
    contents to anyone.
    Thank you for your co-operation.
    **********************************************************************

    --
    Please see the official ORACLE-L FAQ: http://www.orafaq.com
    --
    Author: Malik, Fawzia
      INET: [EMAIL PROTECTED]

    Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
    San Diego, California        -- Public Internet access / Mailing Lists
    --------------------------------------------------------------------
    To REMOVE yourself from this mailing list, send an E-Mail message
    to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
    the message BODY, include a line containing: UNSUB ORACLE-L
    (or the name of mailing list you want to be removed from).  You may
    also send the HELP command for other information (like subscribing).

Reply via email to