久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網
      最全最豐富的資訊網站

      oracle刪除數(shù)據(jù)的命令是什么

      oracle刪除數(shù)據(jù)的命令:1、delete命令,該命令用于刪除表中的數(shù)據(jù),語法為“delete from 表名 where 條件”;2、truncate命令,該命令也可用于刪除數(shù)據(jù),能夠直接將表中的數(shù)據(jù)一次刪除,語法為“truncate table 表名”。

      oracle刪除數(shù)據(jù)的命令是什么

      本教程操作環(huán)境:windows10系統(tǒng)、Oracle 12c版、Dell G3電腦。

      oracle刪除數(shù)據(jù)的命令是什么

      Oracle刪除(delete)

      delete命令

      Oracle中對表數(shù)據(jù)的刪除是利用delete命令進行的。

      delete命令結構:

      delete from 表名 where 條件

      命令解析:

      1、當delete from不加where條件時,表示是把表中的數(shù)據(jù)全部刪除。

      案例1、刪除學生信息表(stuinfo)中學生“張三”的數(shù)據(jù):

      delete  from stuinfo t where t.stuname='張三';

      結果如下:

      oracle刪除數(shù)據(jù)的命令是什么

      truncate命令

      truncate命令也是數(shù)據(jù)刪除命令,他是直接把Oracle表數(shù)據(jù)一次刪除的命令,truncate命令是一個DDL命令,不同于delete是DML命令。

      truncate命令結構:

      truncate table 表名;

      案例2、刪除學生信息備份表(stuinfo_2018):

      truncate table stuinfo_2018;

      結果如下:

      oracle刪除數(shù)據(jù)的命令是什么

      Oracle刪除(delete)

      truncate和delete都能刪除表中的數(shù)據(jù),他們的區(qū)別:

      1、TRUNCATE 是 DDL 命令,命令執(zhí)行完就提交,刪除的數(shù)據(jù)不能恢復; DELETE 命令是 DML 命令,命令執(zhí)行完需提交后才能生效,刪除后的數(shù)據(jù)可以通過日志文件恢復。

      2、如果表中的數(shù)據(jù)量較大,TRUNCATE的速度比DELETE速度快很多。

      3、truncate刪除將重新設置表索引的初始大小,而delete不能。

      4、delete能夠觸發(fā)表上相關的delete觸發(fā)器,而truncate則不會觸發(fā)。

      5、delete刪除的原理是一次一條從表中刪除數(shù)據(jù),并將刪除操作當做事物記錄在數(shù)據(jù)庫的日志當中,以便進行數(shù)據(jù)回滾。而truncate是一次性進行數(shù)據(jù)頁的刪除,因此執(zhí)行速度快,但是不能回滾。

      總結:truncate命令是屬于DDL命令,一次性刪除表中所有數(shù)據(jù),并且數(shù)據(jù)不能恢復,在實際開發(fā)過程當中truncate命令慎用。

      推薦教程:《Oracle視頻教程》

      贊(0)
      分享到: 更多 (0)
      網站地圖   滬ICP備18035694號-2    滬公網安備31011702889846號