Hello,大家好!我是程序員阿飛!今天主要給大家分享一下上週工作以及學習中遇到的知識點。
一、Mysql分組取最大時間的數據
先分組使用 max() 函數查詢出每組中最大的時間和類型,將時間字段和類型字段定義爲一個新表 tmp,再通過與 tmp 表的時間和類型聯合查詢,即可查詢出每組中的最新一條數據(時間最大的那條數據)。之所以要使用時間和類型兩個字段,是因爲可能存在不同類型但時間相同的數據
select * from t_company t RIGHT JOIN (select type, MAX(create_date) as "createDate" from t_company GROUP BY type) tmp on t.create_date = tmp.createDate and t.type=tmp.type
二、replace 雙引號到單引號
str.replace("\"", "\'");
str.replaceAll("\"", "\'");
三、Eclipse上傳代碼到碼雲
參考網址:https://blog.csdn.net/zjsdrs/article/details/78407571
【參考地址】
https://blog.csdn.net/wsjzzcbq/article/details/86691472
https://blog.csdn.net/konglongaa/article/details/51596440