使用select count(*) as sum,time from track where time = 123456789 or time = 987654321查询时,如果表中不存在time为指定的值时会返回null,如何让其返回查询条件里的值,比如让其显示为:
sum time
0 123456789
0 987654321
x .........
而不是
sun time
0 NULL
求高手`
...全文
10233打赏收藏
mysql查询结果为空时显示查询条件里的值
做后台数据统计想按时间段分开统计结果输出 使用select count(*) as sum,time from track where time = 123456789 or time = 987654321查询时,如果表中不存在time为指定的值时会返回null,如何让其返回查询条件里的值,比如让其显示为: sum time 0 123456789 0 987654321 x ......... 而不是 sun time 0 NULL 求高手`