摘葡萄作文mysqltodate怎么⽤_⽤MySQLSTR_TO_DATE替换⽇期格式让我们⾸先创建⼀个表-create table DemoTable(DueDate varchar(100));
多少平方米等于一公顷
使⽤插⼊命令在表中插⼊⼀些记录-inrt into DemoTable values('10-01-2019 10:19:20');
苹果含有哪些维生素inrt into DemoTable values('12-03-2018 11:00:00');毛衣怎么画
inrt into DemoTable values('02-23-2018 04:20:40');
使⽤lect语句显⽰表中的所有记录-lect *from DemoTable;
这将产⽣以下输出-+---------------------+
| DueDate |
玫瑰花叶子+---------------------+
| 10-01-2019 10:19:20 |
| 12-03-2018 11:00:00 |
ps怎么调亮度| 02-23-2018 04:20:40 |
+---------------------+
3 rows in t (0.00 c)
以下是将⽇期格式替换为MySQL STR_TO_DATE的查询-SELECT STR_TO_DATE(REPLACE(DueDate,"'",''), '%c-%e-
m的写法%Y %T') from DemoTable;
这将产⽣以下输出-+-----------------------------------------------------+
| STR_TO_DATE(REPLACE(DueDate,"'",''), '%c-%e-%Y %T') |
+-----------------------------------------------------+
过年有哪些习俗| 2019-10-01 10:19:20 |
| 2018-12-03 11:00:00 |
| 2018-02-23 04:20:40 |
+-----------------------------------------------------+
3 rows in t (0.00 c)