首页 > 技术文章 > mysql数据库中查看某个视图的定义的SQL语句

chuanzhang053 2018-03-08 10:58 原文

环境描述:

  • mysql版本:5.5.57-log
  • 操作系统版本:Red Hat Enterprise Linux Server release 6.6 (Santiago)

需求描述:

  查看某个视图的定义SQL语句

通过information_schema数据库下的views表来进行查询:

SELECT
    table_name,
    table_schema,
    view_definition,
    check_option,
    is_updatable
FROM
    information_schema.views
WHERE
    table_name = 'v_t'\G

查询结果:

说明:其中view_definition字段就是视图的定义。

 

文档创建时间:2018年3月8日10:57:18

 

推荐阅读