Oracle Usage Summary

Source: Internet
Author: User

First, modify the table name to modify the index and the primary key

ALTER TABLE afa_auth_function RENAME to back_afa_auth_function    ----Modify the form name alter tables Back_afa_auth_function RENAME Constraint pk_afa_auth_function to pk_back_afa_auth_function;    ----Modify the PRIMARY key alter index pk_afa_auth_function rename to pk_back_afa_auth_function; ----Modifying indexes

In the integration of different systems, some tables are duplicated, and do not want to delete, this time you can modify the corresponding table name, primary key name, index name

Ii. usage of Case-when

Update Afa_auth_roleSetFsubsystemid= ( CaseWhen Fsubsystemid='C08AF79072F444878C7C5DEEA25187AA' Then'Nontax-platfrom'When Fsubsystemid='896a7961034b4559b4fc4a1520460075' Then'Nontax-base'When Fsubsystemid='8c36fdbdce80424a9ae3f11183e19f47' Then'nontax-agency'When Fsubsystemid='0816b0670e7d428d886e54e7fc0fcb5a' Then'nontax-finance'end);

Pay attention to the relevant wording.

Three, insert and time line number and so on with the use

Insert into afa_org (org_id, Org_code, Org_name, parent_org_id, Org_level, Is_leaf, Org_type, STATUS, Create_time, LAS Test_time)SelectT.fid asorg_id, T.ffindeptcode asOrg_code, T.ffindeptname asOrg_name, T.frgnid asparent_org_id,NULL  asOrg_level,NULL  asIs_leaf,'findept'  asOrg_type, T.fisenable asSTATUS, To_date (T.fcreatetime,'YYYY-MM-DD Hh24:mi:ss') asCreate_time, To_date (To_char (To_timestamp (T.fupdatetime,'YYYYMMDDHH24MISSFF3'),                         'YYYY-MM-DD Hh24:mi:ss'),                 'YYYY-MM-DD Hh24:mi:ss') asLastest_time fromFab_fin_dept T;

Note the use of correlation functions.

Iv. Related Skills

Select ' _ '  as Party_code

by | | Two fields can be merged

    Set where App_id<>'APPCENTER';

<> Not equal to flag

Oracle Usage Summary

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.