检查今天的记录是否已经存在
我有一个带有多列的表1如果存在,如果没有,则
我尝试了查询,但似乎很遥远,任何指导都将不胜感激
SELECT DISTINCT(ANI) as mobile
FROM ODCalls
(CallLocalTime) >= '2022-06-08 00:00:00'
and ANI NOT IN (
select ANI
from ODCalls
WHERE (CallLocalTime) >= '2022-06-01 00:00:00'
and (CallLocalTime) >= '2022-06-07 23:59:59'
)
I have a table with multiple columns where I need to check if the column ANI (ANI is the mobile numbers) called for their first time or they have existing record on the previous dates, I need to return like 1 if exist and 0 if not
I have tried a query but seems to be far away, any guidance will be much appreciated
SELECT DISTINCT(ANI) as mobile
FROM ODCalls
(CallLocalTime) >= '2022-06-08 00:00:00'
and ANI NOT IN (
select ANI
from ODCalls
WHERE (CallLocalTime) >= '2022-06-01 00:00:00'
and (CallLocalTime) >= '2022-06-07 23:59:59'
)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试这样的事情。我不确定有关DateTime可能出现问题的示例数据。该查询应检测到今天已经打了第一个电话的手机。
You can try something like this. I am not completely sure with out sample data about possible issues with datetime. This query should detect mobile phones, which have made the first call today.