Home > Database > Mysql Tutorial > body text

net-mysql数据库查询的格式化

WBOY
Release: 2016-06-06 09:36:57
Original
1014 people have browsed it

mysqlnetsql数据库

本人按一个日期段查询表的记录,为保证统一的处理方式,想让查询结果自动补全,如下所示:
billRec
100元,5人,2015-09-15
200元,6人,2015-09-21

而我想在查询日期为2015-09-15至2015-09-30这个日期区间时显示如下结果:
100元,5人,2015-09-15
0,0,2015-09-16
0,0,2015-09-17
……
200元,6人,2015-09-21
0,0,2015-09-22
0,0,2015-09-23
……
0,0,2015-09-30

也就是不存在的日期自动补为0,日期字段要显示全部。

请高手给个方法,最好是sql实现,如果根本就不应该这么处理,那如何对返回的记录集DataTable上作处理,顿首百拜啊

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!