av一区二区在线观看_亚洲男人的天堂网站_日韩亚洲视频_在线成人免费_欧美日韩精品免费观看视频_久草视

您的位置:首頁/技術(shù)文章
文章詳情頁

MySQL truncate table語句的使用

瀏覽:4日期:2023-10-05 07:09:20

Truncate table語句用來刪除/截斷表里的所有數(shù)據(jù)

和delete刪除所有表數(shù)據(jù)在邏輯上含義相同,但性能更快 類似執(zhí)行了drop table和create table兩個語句

mysql> select * from students_bak;+-----+----------+--------+---------+| sid | sname | gender | dept_id |+-----+----------+--------+---------+| 101 | zhangsan | male | 10 || 1 | aa | 1 | 1 |+-----+----------+--------+---------+2 rows in set (0.00 sec)mysql> truncate table students_bak;Query OK, 0 rows affected (0.16 sec)mysql> select * from students_bak;Empty set (0.00 sec)mysql> set autocommit=off;Query OK, 0 rows affected (0.01 sec)mysql> select * from students3;+-----+-------+--------+---------+--------+| sid | sname | gender | dept_id | sname2 |+-----+-------+--------+---------+--------+| 100 | NULL | 1 | 1 | NULL |+-----+-------+--------+---------+--------+1 row in set (0.01 sec)mysql> truncate table students3;Query OK, 0 rows affected (0.06 sec)mysql> rollback;Query OK, 0 rows affected (0.00 sec)mysql> select * from students3;Empty set (0.00 sec)mysql> delete from students;Query OK, 5 rows affected (0.00 sec)mysql> select * from students;Empty set (0.00 sec)mysql> rollback;Query OK, 0 rows affected (0.07 sec)mysql> select * from students;+-----+-------+--------+---------+| sid | sname | gender | dept_id |+-----+-------+--------+---------+| 1 | aa | 3 | 1 || 4 | cc | 3 | 1 || 5 | dd | 1 | 2 || 6 | aac | 1 | 1 || 10 | a | 1 | 1 |+-----+-------+--------+---------+5 rows in set (0.00 sec)

到此這篇關(guān)于MySQL truncate table語句的使用的文章就介紹到這了,更多相關(guān)MySQL truncate table內(nèi)容請搜索好吧啦網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持好吧啦網(wǎng)!

標(biāo)簽: MySQL 數(shù)據(jù)庫
相關(guān)文章:
主站蜘蛛池模板: 国产精品成人免费视频 | 亚洲一区二区三区四区在线 | 免费黄色av | 天天插天天 | 国产黄在线观看 | 黄色一级大片 | 成年人黄色网址 | 亚洲精品一 | 九九热在线观看 | 亚洲最新网址 | 国产三级在线免费观看 | 午夜精品久久久久久久99黑人 | 欧美国产精品一区二区 | 午夜专区 | 色综合五月 | 日韩hd | 欧洲美一区二区三区亚洲 | 日本特级黄色片 | 亚洲成人免费av | 亚洲区一区二 | 天天综合天天 | 精品国产99久久久久久宅男i | 日韩欧美自拍 | 日韩av在线免费 | 国产精品一二 | 日韩精品一区二区在线 | 狠狠狠干 | 久久久久久久国产精品 | 久青草影院 | 亚洲精品视频在线 | 午夜影院黄 | 国产7777| www.四虎.com| 久色精品 | 成人午夜网| 日韩成人免费视频 | 最近中文字幕在线 | 中文字幕日韩在线观看 | 午夜婷婷 | 色综合天天综合网天天狠天天 | 日韩精品一区二区三区免费视频 |