3
夥計們我想在mysql中使用解析函數lag。在Oracle中它受到支持,但我無法在Mysql中完成。那麼有人可以幫助我如何在Mysql中執行滯後操作嗎? 例如如何在mysql中執行滯後操作
UID Operation
1 Logged-in
2 View content
3 Review
我想使用滯後功能,使我的輸出將如下
UID Operation Lagoperation
1 Logged-in
2 View content Logged-in
3 Review View content
是否支持MySQL的滯後功能???
我認爲沒有內置功能。您可能必須加入同一個表才能獲得此效果。嘗試從這個線程:http://stackoverflow.com/questions/5483319/how-do-i-lag-columns-in-mysql或http://stackoverflow.com/questions/11303532/simulate-lag-function- in-mysql –
不,MySQL不支持任何現代SQL功能(窗口函數,遞歸查詢...)。如果這對你來說真的很重要,你可以考慮升級到Postgres –