mysql查詢每月,mysqltimestamp怎么查詢?
一、當(dāng)天或當(dāng)日插入的數(shù)據(jù):
1、傳統(tǒng)對(duì)比判斷:SELECT*FROM`t`WHEREDATE_FORMAT(addTime,'%Y-%m-%d')=date_format(now(),'%Y-%m-%d')");
2、第一點(diǎn)的簡(jiǎn)寫:SELECT*FROM`t`WHEREaddTime>=date_format(NOW(),'%Y-%m-%d');
一、當(dāng)天或當(dāng)日插入的數(shù)據(jù):
1、傳統(tǒng)對(duì)比判斷:SELECT*FROM`t`WHEREDATE_FORMAT(addTime,'%Y-%m-%d')=date_format(now(),'%Y-%m-%d')");
2、第一點(diǎn)的簡(jiǎn)寫:SELECT*FROM`t`WHEREaddTime>=date_format(NOW(),'%Y-%m-%d');