数据库
首页 > 数据库> > mysql中between and或大于小于查时间,单双引号问题

mysql中between and或大于小于查时间,单双引号问题

作者:互联网

mysql查询时间时,between and和大于小于都可以
单引号,双引号都可以加在时间上,结果一样

以下sql文查询结果都一样

SELECT * FROM tb_user where birthday between '2021-01-01' and '2021-05-05';
SELECT * FROM tb_user where birthday between "2021-01-01" and "2021-05-05";
SELECT * FROM tb_user where birthday between '2021-01-01' and "2021-05-05";
select * from tb_user where birthday >= '2021-01-01' and birthday <='2021-05-05';
select * from tb_user where birthday >= 2021-01-01 and birthday <= '2021-05-05';
select * from tb_user where birthday >= "2021-01-01" and birthday <= "2021-05-05";
select * from tb_user where birthday >= "2021-01-01" and birthday <= '2021-05-05';

在这里插入图片描述

标签:01,双引号,mysql,birthday,2021,between,tb,05
来源: https://blog.csdn.net/djydjy3333/article/details/122774921