sql语句,求大神看看我这句话哪里有错!
问题描述:
sql语句,求大神看看我这句话哪里有错!
select * from
(
select FUNCTIONAL_LOCATION,HDR_END_DATE,row_number()
over(partition by FUNCTIONAL_LOCATION order by HDR_END_DATE ) mm
from T_EODB_CONTRACT_ITM_DEL)
where mm=1;
答
select * from
(
select FUNCTIONAL_LOCATION,HDR_END_DATE,row_number()
over(partition by FUNCTIONAL_LOCATION order by HDR_END_DATE ) mm
from T_EODB_CONTRACT_ITM_DEL) as t
where t.mm=1;
试试这样行不行