我可以撤消-MySQL中的ALTER表吗? [英] Can i undo ALTER table in - MySQL?

查看:76
本文介绍了我可以撤消-MySQL中的ALTER表吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

不知道是否可行,我将VARCHAR列更改为要回滚的十进制类型.因为它将所有浮点值混合为整数.像2.00变成200.有什么方法可以撤消我的上一张表Alteration?请告知.

Don't know if it's possible, I Altered VARCHAR column to Decimal Type which i want to Rollback. Because it blended all floating values as integer. like 2.00 became 200. Is there any way to undo my last table Alteration? Please advise.

推荐答案

不,您不能回滚ALTER TABLE语句.

https://dev.mysql.com /doc/refman/5.7/en/cannot-roll-back.html

某些语句无法回滚.通常,这些语句包括数据定义语言(DDL)语句,例如创建或删除数据库的语句,创建,删除或更改表或存储例程的语句.

Some statements cannot be rolled back. In general, these include data definition language (DDL) statements, such as those that create or drop databases, those that create, drop, or alter tables or stored routines.

(重点是我的)

正如Chris Peters上面的评论,您可以执行相反的ALTER TABLE操作,然后使用UPDATE语句清理数据.

As Chris Peters comments above, you can do the reverse ALTER TABLE operation, and then clean up your data using UPDATE statements.

这篇关于我可以撤消-MySQL中的ALTER表吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆