cash warrenmysql⽇期⼩于当前⽇期_如何使⽤MySQL选择⼩于当前⽇期
的⽇期?
让我们⾸先创建⼀个表-mysql> create table DemoTable1877
(
DueDate datetime
);
使⽤插⼊命令在表中插⼊⼀些记录-mysql> inrt into DemoTable1877 values('2019-12-10');
mysql> inrt into DemoTable1877 values('2019-12-05');
mysql> inrt into DemoTable1877 values('2019-12-07');
mysql> inrt into DemoTable1877 values('2019-12-09');
使⽤lect语句显⽰表中的所有记录-mysql> lect * from DemoTable1877;
变色龙用英语怎么说
这将产⽣以下输出-+---------------------+
| DueDate |
成考英语作文
+---------------------+
motel是什么意思
| 2019-12-10 00:00:00 |采纳
别对我撒谎
| 2019-12-05 00:00:00 |
| 2019-12-07 00:00:00 |
| 2019-12-09 00:00:00 |
halliburton
英语口语考试+---------------------+
4 rows in t (0.00 c)
当前⽇期如下-mysql> lect curdate();
+------------+
| curdate() |
thursday怎么读
+------------+
| 2019-12-08 |
+------------+
1 row in t (0.00 c)
这是选择⼩于当前⽇期的⽇期的查询-mysql> lect * from DemoTable1877 where DueDate
这将产⽣以下输出-+---------------------+
| DueDate |
urumqi+---------------------+
| 2019-12-05 00:00:00 |
| 2019-12-07 00:00:00 |
+---------------------+
2 rows in t (0.00 c)