non dovresti usare ROW_NUMBER()
,
- usa
DENSE_RANK()
invece - rimuovi
PARTITION BY
interrogazione,
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
- Demo SQLFiddle