Hi All,
I'm able to run the below query:-
But I wan't to run the query something like this:-
Can anybody tell me why? Does CTE doesn't work into sub-query?
Thanks
regards,
Kumar
I'm able to run the below query:-
With x as ( Select eso, iso, dt row_number() Over(Partition By ISNULL(eso, iso) Order By iso Desc) AS rn From NewOrder ) Select eso, Case When iso is NULL then eso else iso End As iso, dt from x where rn = 1
But I wan't to run the query something like this:-
Select eso, Case When iso is NULL then eso else iso End As iso, dt from (With x as ( Select eso, iso, dt row_number() Over(Partition By ISNULL(eso, iso) Order By iso Desc) AS rn From NewOrder ) ) where rn = 1
Can anybody tell me why? Does CTE doesn't work into sub-query?
Thanks
regards,
Kumar