使用modify修改字段报错如下: mysql> alter table student modify name sname char(16);ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sname char(16)' at line
首先我们需要了解下查询MySQL数据库/表相关信息的SQL语句: 代码如下: SHOW DATABASES //列出 MySQL Server 数据库.SHOW TABLES [FROM db_name] //列出数据库数据表.SHOW CREATE TABLES tbl_name //导出数据表结构.SHOW TABLE STATUS [FROM db_na
原文:mysql通过字段注释查找字段名称 有时候表的字段太多,只是大致记得表的注释,想通过字段注释查找字段名称,可以用如下语句: SELECT COLUMN_NAME,column_comment FROM INFORMATION_SCHEMA.Columns WHERE table_name='tj_record' AND table_schema='tianjin_20140811' AND column_comment LIKE '%数据是否有效%' 其中table_schema为数据库