开发者

Make a fake schedule if it doesn't exist in db

I want to pull all the rows from a database for a month and if there are any rows in the beginning or in the end that are missing then I want to create fake rows, so every day there is 开发者_高级运维a schedule that one has to follow. How can I detect missing rows or how can I solve this issue?


From how to fill up the missing dates ??

fill a calendar table use that as your driving table (i.e. first one in your select) and do a LEFT JOIN on it.

Create and fill a calendar table

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜