Oracle Sql相關記錄

2021-07-05 07:28:33 字數 612 閱讀 7386

1. 批量增加資料

insert into fasp_t_carolemenu(guid, roleguid, menuguid)  

select sys_guid(), guid, '43b3bf934c324381892fe59f3d244629'  from fasp_t_carole 

where length(province) = 6 and province not in (select code || '00' from v_ppp_dist_ext)  

2. 字元/字段拼接

select id || '00' from table

3. 擷取字串

select substr('str12345678', 0, 3) from dual

乙個引數為要擷取的字串;第二個引數為從哪開始擷取,如果為負數,那麼從最後倒數幾個字元開始擷取;第三個引數為,擷取幾位。

4. 金額格式化

select to_char(nvl(money, 0), '9,999,999,999') from table

oracle sql 優化相關

1 oracle net 單次獲取結果集 預設10條 可修改array size,jdbc fetchsize 2 針對大統計 union all 等改為分析函式提公升效能 3 既然null是可以進復合索引的,在我們需要對null進行索引時,就可以構造乙個 偽復合索引 create index my...

oracle sql相關語法

case when 簡單case函式 case when 1 then 男 when 2 then 女 else 其他 end case搜尋函式 case when 1 then 男 when 2 then 女 else 其他 end這兩種方式,可以實現相同的功能。簡單case函式的寫法相對比較簡潔...

Oracle Sql使用記錄

oracle當前時間 及轉換 select to char sysdate,yyyy mm dd hh24 mi ss now,to char sysdate interval 1 year,yyyy mm dd hh24 year1,1 year ago to char sysdate 10,yy...