【问题标题】:how do i validate already table in mysql schema?我如何验证 mysql 模式中的已有表?
【发布时间】:2018-07-30 08:00:28
【问题描述】:

无法验证 MySQL 中是否存在表。

尝试了下面的查询,但没有输出。

if !(select * from information_schema.tables where table_name='sy_code')

【问题讨论】:

  • 没有输出意味着不存在兄弟

标签: mysql flyway


【解决方案1】:

要查看表的架构,请使用查询

DESCRIBE table_name;

要查看我们数据库中的所有现有表,请使用查询

SELECT table_name FROM information_schema.tables WHERE table_schema = 'your_db'

【讨论】:

    猜你喜欢
    • 2020-01-10
    • 1970-01-01
    • 1970-01-01
    • 2016-05-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-02-17
    相关资源
    最近更新 更多