低版本mysql 实现row_number() ,rank() ,dense_rank()及其窗口函数
测试表createtabletest(idint(4),nameVARCHAR(10))row_number()实现SELECTt.name,t.id,(@cur_rank:=@cur_rank+1)rankingFROMtestt,(SELECT@cur_rank:=0)rORDERBYidDESC;ROW_NUMBER()over(partitonbynameORDERBYidDESC)实现@