范式
DATE_FORMAT(tCreate,'%Y-%m-%d %H:%i:%s') BETWEEN DATE_FORMAT('2022-10-12 00:00:00','%Y-%m-%d %H:%i:%s') AND DATE_FORMAT('2022-10-12 23:59:59','%Y-%m-%d %H:%i:%s')
示例
SELECT DATE_FORMAT(tCreate,'%Y-%m-%d %H:%i:%s'),DATE_FORMAT('2022-10-12 00:00:00','%Y-%m-%d %H:%i:%s'),DATE_FORMAT('2022-11-12 23:59:59','%Y-%m-%d %H:%i:%s') FROM TbGoodsOrder WHERE DATE_FORMAT(tCreate,'%Y-%m-%d %H:%i:%s') BETWEEN DATE_FORMAT('2022-10-12 00:00:00','%Y-%m-%d %H:%i:%s') AND DATE_FORMAT('2022-10-12 23:59:59','%Y-%m-%d %H:%i:%s')
网友评论