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 )))