当前位置:网站首页>mysql 使用 DATE_FORMAT(date,'%Y-%m')
mysql 使用 DATE_FORMAT(date,'%Y-%m')
2022-07-29 07:29:00 【CSDN问答】
mysql 使用 DATE_FORMAT(date,'%Y-%m') 取月份 获取到的数据全部是null

但是我使用(date,'%Y-%m-%d') 去获取数据的时候就,就可以获取到数据

猜测:
是时间格式化的问题,但是没有找到方法去解决,因为我获取的数据就是 ’2022-07‘,也是根据这个条件去查询的,所有请教一下各位,如何解决这个问题。
解决:
我是在service层重新做的处理 因为获取到数据是null,我加了一个判断,重新进行分割之后再进行赋值,但是比较想再mysql中做处理,而且这个问题出现的原因不清楚,所以请教一下各位。
边栏推荐
- PAT甲级 1150 旅行商问题
- Description of rollingfileappender attribute in logback
- 写点dp
- Segger's hardware anomaly analysis
- stm32 操作W25Q256 W25Q16 spi flash
- Gin routing, parameters, output
- [MySQL] - [subquery]
- [summer daily question] Luogu p6336 [coci2007-2008 2] bijele
- Job 7.28 file IO and standard IO
- [100 cases of unity practice] the single choice multiple choice judgment questions of unity universal question answering system are all common
猜你喜欢
Scala higher order (10): exception handling in Scala

Latest 10 billion quantitative private placement list

NFT 的 10 种实际用途

RoBERTa:A Robustly Optimized BERT Pretraining Approach

0 9 布隆过滤器(Bloom Filter)
![Explanation of suffix automata (SAM) + Luogu p3804 [template] suffix automata (SAM)](/img/8b/f68503e09f218c26e34453b1b7fcd5.png)
Explanation of suffix automata (SAM) + Luogu p3804 [template] suffix automata (SAM)

js第四天流程控制(if语句和switch语句)

Log4qt memory leak, use of heob memory detection tool

Prometheus与Grafana

QT topic: basic components (button class, layout class, output class, input class, container class)
随机推荐
3-global exception handling
Use of gcc/g++
Scala higher order (10): exception handling in Scala
多线程购物
Using C language to skillfully realize the chess game -- Sanzi chess
[summer daily question] Luogu p7760 [coci2016-2017 5] tuna
Meeting notice of OA project (Query & whether to attend the meeting & feedback details)
性能更佳、使用更简单的懒加载IntersectionObserverEntry(观察者)
2022年深圳杯A题破除“尖叫效应”与“回声室效应”走出“信息茧房”
关于大龄读博的几点回答?
BeanUtils.setProperty()
Introduction and introduction of logback
Amazon cloud assistant applet is coming!
js第四天流程控制(if语句和switch语句)
zip gzip tar压缩进阶版
STM32 operation w25q256 w25q16 SPI flash
Description of rollingfileappender attribute in logback
Introduction to logback appender
【Unity实战100例】Unity万能答题系统之单选多选判断题全部通用
Introduction to logback filter