gpt4 book ai didi

MySQL information_schema.columns 额外列选项

转载 作者:行者123 更新时间:2023-11-29 02:14:19 24 4
gpt4 key购买 nike

我没有找到任何有关的文档。 information_schema.columns 表 extra 列的可能选项是什么。目前我只是得到 auto_increment。我只是在构建一个迁移器,我想涵盖所有可能性。

获取它的SQL查询:

SELECT EXTRA
FROM information_schema.COLUMNS;

最佳答案

尽管 The INFORMATION_SCHEMA COLUMNS Table 未记录该列可能值的完整列表,您可以在 SHOW COLUMNS Syntax 的手册页上找到它:

The Extra field contains any additional information that is available about a given column. The value is nonempty in these cases:

  • auto_increment for columns that have the AUTO_INCREMENT attribute

  • on update CURRENT_TIMESTAMP for TIMESTAMP or DATETIME columns that have the ON UPDATE CURRENT_TIMESTAMP attribute

  • VIRTUAL GENERATED or STORED GENERATED for generated columns

请注意,VIRTUAL GENERATEDSTORED GENERATED 值是 MySQL 5.7 中的新值,并且可能会在 MySQL 8.0 及更高版本中添加更多值。

关于MySQL information_schema.columns 额外列选项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42631328/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com