Oracle common terms and statements

Source: Internet
Author: User

Oracle common syntax and statement collections 1. case when example select task_id taskId, start_time startTime, end_time endTime, status, plan_type planType, is_manual isManual, is_pilotCal isPilotCal, scheduling_code schedulingCode from log_schedule_plan where plan_type = 'respiratory _ SCHEDULING_PLAN 'and sysdate> (case when is_manual = 0 then (start_time + interval '10' minute) else (start_time + interval '2' minute) end) 2. merge example merge into wll using (select wareh_id, prod_id, locked_type, sum (locked_qty) locked_qty from region where id = # batchId # group by wareh_id, prod_id, locked_type) uwllt on (wll. wareh_id = uwllt. wareh_id and wll. prod_id = uwllt. prod_id and wll. locked_type = uwllt. locked_type) when matched then update set wll. locked_qty = nvl (wll. locked_qty, 0) + nvl (uwllt. locked_qty, 0), stk_change_date = descriimestamp when not matched then insert (PROD_ID, WAREH_ID, locked_type, locked_qty, STK_CHANGE_DATE) values (uwllt. prod_id, uwllt. wareh_id, uwllt. locked_type, uwllt. locked_qty, systimestamp) ps: records associated with query by self-query. Only one record is required; otherwise, an error is returned. 3. upper (lsp. task_id) = lower (lsp. to determine whether the task_id field is a pure number. For example: select * from log_schedule_plan lsp where (upper (lsp. task_id) = lower (lsp. task_id )))

Related Article

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.