I've MSSQL Query with DISTINCT and ROW_NUMBER(),
QUERY IS:
SELECT * from
(select ROW_NUMBER() OVER (ORDER BY b.tc_priority ) AS row,
DISTINCT a.tc_id
from release_details a, tc_details b
where a.tc_id=b.tc_name
and
tst_system is null
and release_name='sdkfei'
and tenv_id='32'
and env_id='32'
and tst_type='21'
and b.autotech='ITL'
and a.project=b.project
and a.project='JupiterQA'
and depclosed=1) AS tab12
WHERE row BETWEEN 1 AND 5
ERROR IS: Incorrect syntax near the keyword 'DISTINCT'
Is anything wrong with this query?