优化sql语句

This commit is contained in:
heavyrain2012
2021-04-24 08:08:26 +08:00
parent 7706efcf8c
commit 3c9ed877b5
@@ -696,7 +696,7 @@ public class DatabaseStore {
}
MessageBundle getMessage(long messageId) {
String sql = "select `_from`, `_type`, `_target`, `_line`, `_data`, `_dt` from " + MessageShardingUtil.getMessageTable(messageId) +" where _mid = ? limit 1";
String sql = "select `_from`, `_type`, `_target`, `_line`, `_data`, `_dt` from " + MessageShardingUtil.getMessageTable(messageId) +" where _mid = ? order by `_dt` DESC limit 1";
Connection connection = null;
PreparedStatement statement = null;
ResultSet resultSet = null;