开发者

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

开发者 https://www.devze.com 2022-12-20 18:08 出处:网络
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 开发者_高级运维

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

精彩评论

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