Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

Row Number and Select Distinct Query - forum topic by SR_Stage

$
0
0

Good morning TD community,
I've been working on a writing a distinct query that returns as a single concatenated string (it has to be fed into a system that is expecting fixed-length field based on position) and I have a requirement to number the rows.  I've attempted several methods of row numbers but I continue to get the result of all the rows being numbered before the distinct condition of the select is applied.  So I am expecting 13 rows, but I get 91 because if you don't use the distinct condition, that's how many rows there are.  I need number off the rows 1-13. 
Is there a way to apply a row number to the distinctly selected rows?  

Forums: 

Viewing all articles
Browse latest Browse all 14773

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>