当前位置: 数据库>mysql
mysql判断字段是否存在的方法
来源: 互联网 发布时间:2014-10-13
本文导语: 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 table...
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%'
格式: 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%'