How automatically add 1 year date to an existing date in SQL Server

后端 未结 3 1122
抹茶落季
抹茶落季 2021-01-18 12:16

I have a task to automatically bill all registered patients in PatientsInfo table an Annual Bill of N2,500 base on the DateCreated column.

<
3条回答
  •  鱼传尺愫
    2021-01-18 12:50

    Assuming the columns of the 2 tables are the same:

    INSERT INTO PatientDebit
    SELECT * from PatientsInfo WHERE DateCreated

    Make sure you have an index on DateCreated if PatientsInfo has a lot of records as it could potentially be slow otherwise

提交回复
热议问题