oracle-日常筆記____oracle

來源:互聯網
上載者:User
1.替換文字
UPDATE `table_name` SET `field_name` = replace (`field_name`,'from_str','to_str') WHERE ……說明:table_name —— 表的名字 field_name —— 欄位名 from_str —— 需要替換的字串 to_str —— 替換成的字串 


2.排序
用 DESC 表示按倒序排序(即:從大到小排序)
用 ACS   表示按正序排序(即:從小到大排序) 


3.清空一個名為abc的表
truncate table abc;
delete from abc;


4.pl\sql可執行檔位置
在安裝目錄裡的比如:
匯入imp:
F:\app\Administrator\product\11.1.0\db_1\BIN\imp.exe
匯出exp:
F:\app\Administrator\product\11.1.0\db_1\BIN\exp.exe
sql插入:
F:\app\Administrator\product\11.1.0\db_1\BIN\sqlplus.exe


5.以B表H欄位的重複量來對A表的資料進行排序,至於是升序還是降序
select a.* from a
left join(
select h,count(*) as c_num from b group by h ) t
on a.h=t.h
order by t.c_num desc/asc
6.資料表空間增加資料檔案,達到擴大資料表空間目的:
alter tablespace lineloss add datafile 'E:\.....\lineloss2.dbf' size 500m autoextend on next 50m maxsize unlimited;

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.