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';