mysql如何按條件提取每小時(shí)最后一條數(shù)據(jù)?
可以按照步驟如下:
按照時(shí)間統(tǒng)計(jì)數(shù)據(jù)行數(shù)
select count(*) from table_name where date >= 'xxx' and date <='xxx';
2. 按照統(tǒng)計(jì)行數(shù)可以直接通過(guò)limit提取最后一行
select * from table_name limit xxx;
mysql如何按條件提取每小時(shí)最后一條數(shù)據(jù)?
可以按照步驟如下:
按照時(shí)間統(tǒng)計(jì)數(shù)據(jù)行數(shù)
select count(*) from table_name where date >= 'xxx' and date <='xxx';
2. 按照統(tǒng)計(jì)行數(shù)可以直接通過(guò)limit提取最后一行
select * from table_name limit xxx;