删除日期最不更新的行

时间:2017-02-23 20:30:54

标签: sql sql-server

如何删除dateupdated最少更新的行?

我的桌子是

var params = {
    TableName: 'REPORT_CARD',

    KeyConditionExpression: "parition_key_attr = :partition_val #timestamp BETWEEN :startDate AND :endDate",
    ExpressionAttributeNames: { "#timestamp": "timestamp" },
    ExpressionAttributeValues: {
        ':partition_val': "somevalue",
        ":startDate": startDate,
        ":endDate": endDate
    }  

我希望在删除数据后留下以下内容:

Name  Dateupdated  ID    status 
john  1/02/17     JHN1     A   
john  1/03/17     JHN2     A   
sally 1/02/17     SLLY1    A   
sally 1/03/17     SLLY2    A  
Mike  1/03/17     MK1      A   
Mike  1/04/17     MK2      A  

0 个答案:

没有答案