no deberías usar ROW_NUMBER()
,
- usa
DENSE_RANK()
en cambio - eliminar
PARTITION BY
consulta,
SELECT hl.ts_DateTime,
hl.Tagname as [ID],
hl.TagValue as [Value],
DENSE_RANK() OVER (ORDER BY ts_datetime) AS RowFilter
FROM Table1 hl
ORDER BY RowFilter
- Demostración de SQLFiddle