mysql 使用 in做 查询时,结果显示 in中的数据

SELECT
    IFNULL( MAX( now_date ), now_date ) AS now_date,
    IFNULL( MAX( heat_value ), 0 ) AS heat_value,
    IFNULL( MAX( max_temperature ), '0' ) AS max_temperature,
    IFNULL( MAX( min_temperature ), '0' ) AS min_temperature,
    COUNT( now_date ) 
FROM
    tb_heat_chart 
WHERE
    project_id =1 
    AND now_date in ('2022-10-27','2022-10-28')

代码中查询结果now_date字段想要显示where中now_date的每个数值,该怎么去改这个语句,求各位给个思路或答案,拜托了

讨论数量: 6

GROUP_CONCAT ?

1年前 评论
rgxhn_out (楼主) 1年前

where里面的now_date换成IFNULL( MAX( now_date ), now_date ),因为where检索的时候没有now_date字段,这是展示的时候格式化出来的

1年前 评论
rgxhn_out (楼主) 1年前
Imuyu (作者) 1年前

file 是这样写的吗

1年前 评论

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!