获得非付费会员

发布于 2024-11-28 23:19:51 字数 544 浏览 2 评论 0原文

我有一张会员表,

 member_Id
 member_Firstname

另一张表 Paymentschedules

  paymentschedule_Id
  member_Id
  paymentschedule_amountdue values(100 rs,200rs)
  paymentschedule_amonutpaid values (30 rs,40 rs)
  paymentschedule_ActualDatetobepaid  values(2011-02-03,2011-02-01,2011-03-01)
  paymentschedule_ datepaid  values like(2011-09-12,2011-08-10,2011-11-12,2010-08-01)

我的问题是,考虑到这些值“ActualDatetobepaid”和“amonutpaid”以及“amountdue”和“datepaid”,我可以获取截至“今天”逾期的会员名字吗

?任何人都可以提供帮助吗?一

I have a member table

 member_Id
 member_Firstname

another table Paymentschedules

  paymentschedule_Id
  member_Id
  paymentschedule_amountdue values(100 rs,200rs)
  paymentschedule_amonutpaid values (30 rs,40 rs)
  paymentschedule_ActualDatetobepaid  values(2011-02-03,2011-02-01,2011-03-01)
  paymentschedule_ datepaid  values like(2011-09-12,2011-08-10,2011-11-12,2010-08-01)

My problem is can i get the members firstname who are overdue upto "today" taking into account these values "ActualDatetobepaid" and "amonutpaid " and "amountdue" and "datepaid"

Can any one help on this one

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

放我走吧 2024-12-05 23:19:51

您的最后一个请求“添加 7 天”通过在 J0HN 的解决方案中添加 7 天来解决:

SELECT DISTINCT member_Firstname  
FROM member m 
  JOIN Paymentscedules p ON p.member_id = m.member_id 
WHERE DATE_ADD(paymentschedule_ActualDatetobepaid, INTERVAL 7 DAY)< NOW() 
  AND paymentschedule_amountdue > paymentschedule_amonutpaid

Your last request, "Add 7 days", is solved by adding 7 days to J0HN's solution:

SELECT DISTINCT member_Firstname  
FROM member m 
  JOIN Paymentscedules p ON p.member_id = m.member_id 
WHERE DATE_ADD(paymentschedule_ActualDatetobepaid, INTERVAL 7 DAY)< NOW() 
  AND paymentschedule_amountdue > paymentschedule_amonutpaid
只是我以为 2024-12-05 23:19:51

不确定我理解列的含义,但试试这个:

select distinct member_Firstname 
from member m
join Paymentscedules p on p.member_id = m.member_id
where paymentschedule_ActualDatetobepaid<now() and paymentschedule_amountdue > paymentschedule_amonutpaid

如果您可以提供该列的数据类型用户和列含义,我可以提出更精确的解决方案。

Not sure I understand columns' meanings, but try this:

select distinct member_Firstname 
from member m
join Paymentscedules p on p.member_id = m.member_id
where paymentschedule_ActualDatetobepaid<now() and paymentschedule_amountdue > paymentschedule_amonutpaid

If you could provide data types user for that columns and column meanings I could come up with more precise solution.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文