我只是在学习 SQL,所以我还有很长的路要走。我试图在一个customer表中写一个更新,显示任何客户在他们的帐户上拖欠 30 天,并使他们处于非活动状态。
我的表包括:Customerid, Firstname, Lastname, Startdate, Billingcycle, Phone, Streetaddress, City, State, Zip, Employeeid, Status, Reason, Statusdate, 和Email.
我尝试了以下方法,但没有运气;
UPDATE customer
SET status = (
SELECT status
FROM customer
WHERE status = billingcycle + 30)
WHERE status = 'INACTIVE';
这里有什么帮助吗?