SELECT all records that are 30 days old

后端 未结 4 701
盖世英雄少女心
盖世英雄少女心 2020-12-11 22:57

I need to SELECT all records that are 30 days old. I have the code below but it\'s not working. In updatestatus I have dates like 12/26/2011. I create a 30 day old date like

4条回答
  •  萌比男神i
    2020-12-11 23:21

    This is what I used. Very simple

    $sth = $dbh->prepare(qq(SELECT * FROM people WHERE updatestatus + INTERVAL 30 DAY <=     NOW() )) or die $DBI::errstr;
    

提交回复
热议问题