SQL: retrieve only the records whose value has changed

后端 未结 7 1429
一整个雨季
一整个雨季 2020-12-17 02:13

Sorry for the nondescript title. I\'ll edit as we go along.

I have a table RateTable:

| Code   |  Date     |   Rate  |

  B001     2009-         


        
7条回答
  •  庸人自扰
    2020-12-17 02:33

    I would add [ModifiedDate] column to your table and update it's value each time new record is inserted or updated. Then you will be able to get data from the table based on that column:

    SELECT * FROM [YourTable] WHERE [ModifiedDate] > '2008-01-20 10:20'
    

提交回复
热议问题