Home > Database > Mysql Tutorial > MySQL 插入数据 date 格式

MySQL 插入数据 date 格式

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 15:52:57
Original
2144 people have browsed it

在MySQL 中 插入数据时, 字符串型值要用双引号或单引号引起来,数值型不用引号(加引号就会报错) 在插入日期date 时 正确的格式是 '0000-00-00' 例如 name (varchar20), age (int 11) , birth(date) 那么插入格式是 insert into tablename values("name_of_v

在MySQL 中 插入数据时, 字符串型值要用双引号或单引号引起来,数值型不用引号(加引号就会报错)

在插入日期date 时  正确的格式是 '0000-00-00'

例如 name (varchar20), age (int 11) , birth(date)

 

那么插入格式是

 insert into tablename values("name_of_value",20,'2010-12-12');

注意了  这个 age 是 int 数据型 所以20 可以不用引起来 也可以加上 而 birth是 date型 需要按0000-00-00 格式用单引号引起来

Related labels:
source:php.cn
Statement of this Website
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
Latest Issues
MySQL stops process
From 1970-01-01 08:00:00
0
0
0
Error when installing mysql on linux
From 1970-01-01 08:00:00
0
0
0
phpstudy cannot start mysql?
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template