我试图删除Index.html/Another.html
大于3周的任何记录,但我不确定如何实施此操作。问题似乎与连接语法有关。
FeeDueDate
答案 0 :(得分:0)
您需要指定要删除的表格。例如:
DELETE Fees
FROM Assignment.dbo.PupilDetails PDetails JOIN
Assignment.dbo.TuitionFees Fees
ON PDetails.Pupil_ID = Fees.Pupil_ID
WHERE FeeDueDate < dateadd(WEEK, -3, getdate());
答案 1 :(得分:0)
请尝试此查询: -
CREATE PROC spAreFeesOverDue
AS
BEGIN
DELETE
FROM Assignment.dbo.PupilDetails PDetails
join Assignment.dbo.TuitionFees Fees
ON PDetails.Pupil_ID = Fees.Pupil_ID
WHERE FeeDueDate < dateadd(WEEK, -3, getdate())
END;