下面是MSSQL。我试图找到以下查询的MySQL等价物:
select distinct inv.name as InvName
,slotapproval.value
,rank() over (partition by inv.name,slots.customerid order by cast(slots.date as date) desc) as RankDESC
,rank() over (partition by inv.name,slots.customerid order by cast(slots.date as date) asc) as RankASC
from slotapproval
INNER JOIN slots ON slots.slotid=slotapproval.slotid
INNER JOIN inv ON slotapproval.invid=inv.invid
基本上我正在尝试排序desc / Asc。非常感谢任何帮助