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

ROW_NUMBER() same values - forum topic by Fazol

$
0
0

Hi All,
regarding to ROW_NUMBER(). If I have same values for part PARTITION and ORDER BY then How does "ROW_NUMBER()" decide which records will have result = 1 and result = 2?
Example of table
1. row ... col1 = abc, col2 = 1
2. row ... col1 = abc, col2 = 1
3. row ... col1 = xyz, col2 = 99
 

select
<table>.*
ROW_NUMBER() OVER(PARTITION BY col1 ORDER BY col2)
from <table>

Expected result is
abc,1,1
abc,1,2
xyz,99,1
 
many thanks
Rene

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>