Quantcast
Channel: Teradata Forums - All forums
Viewing all articles
Browse latest Browse all 27759

Is there a limitation on the Merge statement and Rank Function? - response (4) by abhi_insignia

$
0
0
Hi KS42982, Table structure is Create Set Table Database.Table ( Account_Number decimal(16,0) not null, Date_Added Date Format 'YYYY-MM-DD' not null, Time_Added Time(6) format 'hh:mi:ss.s(6)' not null, Dept Varchar(10) ) Primary Index(Account_Number, Date_Added); Queries -------------   Insert into Database.Table values ( 100,'2013-01-01','10:14:27.196005', 'BCMD'); Insert into Database.Table values ( 100,'2013-01-01','10:14:27.196008', 'AMEX');   Select T1.*, rank(Account_Number, Date_Added,Time_Added) from Database.Table where Account_Number = 100 and Date_Added = '2013-01-01' group by Account_Number, Date_Added,Time_Added order by Account_Number, Date_Added,Time_Added;   Since Time_Added has a different value, rank '1' should be assigned to both the records. However, the above query is returning the rank as 1 and 2. Seems the value of Time_Added is getting truncated to a common value internally during the execution of query.

Viewing all articles
Browse latest Browse all 27759

Trending Articles



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