如何从计划作业中检索表中的记录 [英] How can I retrieve the records from table from scheduled jobs

查看:87
本文介绍了如何从计划作业中检索表中的记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友们,



我有一个表名为msg_scheduler。其中我将scheduleInterval列值保存为数字(1/2/3/4分别为一次/每日/每周/每月)。



我有另一列schedule_days我用逗号分隔值保存星期几(1,3)[星期一/星期三 - 我将星期一作为我的第一天)。



现在我必须按日计划记录。



假设我预定了3条消息。

喜欢: -

1)一次性消息预定于3月10日星期一至5月下午

2)每日消息定于下午5点

3)每周消息定于周一/周五下午5点

3)每月msg计划每月10日下午5点



如何编写sql查询来获取满足的记录所有上述标准都在一个声明中。





提前谢谢...

Hi Friends,

I have a table names msg_scheduler. In which I am keeping scheduleInterval column value in numeric(1/2/3/4 for onetime/daily/weekly/monthly respectively).

I have another column schedule_days in which I keep day of week in comma-separated value (1,3)[mon/wed - i am setting mon as my first day of week) .

Now I have to get the records in daily basis it is scheduled in.

suppose i have 3 messages scheduled.
Like: -
1) one time msg scheduled for Mon-10 march 5pm
2) daily msg scheduled for 5pm
3) weekly msg scheduled for Mon/Wed 5pm
3) monthly msg scheduled for every month 10th day 5pm

How can I write the sql query to fetch the records which meets all the above criteria in one statement.


Thanks in advance...

推荐答案

我已经解决了Where子句中Case Case的问题。
I have solved my issue with Case Statement inside Where clause.


这篇关于如何从计划作业中检索表中的记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆