mysql字段怎么判断是否存在
1. desc 命令
格式:
desc tablename columnname
例子:
desc `table` `mid` desc `table` '%abc%'
2. show columns 命令
格式:
show columns from tablename like columnname
例子:
show columns from `table` like 'mid' show columns from `table` like '%abc%'
3. describe 命令
格式:
describe tablename columnname
describe 相當于 show columns from
例子:
describe `table` `mid` describe `table` '%abc%'