![]() |
|
Archives of the TeradataForumMessage Posted: Mon, 31 May 2010 @ 10:45:29 GMT
Hi all. Assume we have two data sets:
First: Second:
X Y
1 2
1 2
Rank function will return 2 (value) for both data sets because the values placed both in X and Y are equal. Thus
Select x, rank() over(order by x) r from First
Will return:
X, r
1, 2
1, 2
For Second - the same situation. So, how do you think what join with condition First.r = Second.r will return? It will return 4!!! Rows! And now the question to Syed: How many rows should return the query due to your business logic? Best regards, Dmitriy Boyko
| ||||||||||||||||||||||||||||||||||||||||||||||||
| | ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||
| Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
| Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||