Home  >  Article  >  Backend Development  >  mysql某列的默认值替另一列,有办法么>

mysql某列的默认值替另一列,有办法么>

WBOY
WBOYOriginal
2016-06-13 13:24:541026browse

mysql某列的默认值为另一列,有办法么>
ip varchar(20),
name vachar(20)

我现在要使insert语句没有给出name的值时就填入ip的值,也就是NOT NULL DEFAULT VALUE怎么写,有这个办法吗

------解决方案--------------------
为什么不能程序处理呢,在插入前处理数据?

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn