[MySQL]Transactionでdtテーブルの削除

LINEで送る
Pocket

mysql> START TRANSACTION;
Query OK, 0 rows affected (0.00 sec)

mysql> delete from daily_profile_views where dt='2018-05-30';
Query OK, 13031 rows affected (0.60 sec)

mysql> delete from daily_profile_views where dt LIKE '2018-%';
Query OK, 8843 rows affected, 1 warning (0.30 sec)

mysql> select count(*) from daily_profile_views;
+----------+
| count(*) |
+----------+
|        0 |
+----------+
1 row in set (0.00 sec)


mysql> select * from daily_profile_views limit 10;
Empty set (0.01 sec)

mysql> ALTER TABLE daily_profile_views AUTO_INCREMENT = 1;
Query OK, 0 rows affected (0.04 sec)
Records: 0  Duplicates: 0  Warnings: 0

mysql> commit;
Query OK, 0 rows affected (0.01 sec)

mysql> select * from daily_profile_views limit 10;
Empty set (0.00 sec)

Was this helpful?

0 / 0

コメントを残す 0

Your email address will not be published. Required fields are marked *