Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我们有一个包含 2 列的通知日志表 - 电子邮件地址 notification_sent_time
我需要找出在最后“n”秒内发送到特定电子邮件地址的通知数量。如何做到这一点?
谢谢
您可能正在寻找 datediff 函数。
WHERE email_address = {email} and DATEDIFF('ss', notification_sent_time, GETDATE()) > 2
WHERE email_address = {email} AND notification_sent_time > {N seconds ago}