How to get latest record for the same customer
Teradata Teradata Discussion Forums Teradata.com Discussion Forum
Visit Teradata.com
Home       Guidelines    Member List
Welcome Guest ( Login | Register )
        


This online forum is for user-to-user discussions of Teradata products, and is not an official customer support channel for Teradata. If you require direct assistance, please contact Teradata support.


How to get latest record for the same... Expand / Collapse
Author
Message
Posted 8/14/2009 5:04:13 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: Yesterday @ 1:22:20 AM
Posts: 3, Visits: 106
How to get latest record for the same customer







2) if suppose in the customer id 10 i have 100 records. how to pick the latest,oldest record for that particular id 10. please give me SQL query in teradata







3) second question is how to give the ranks for all records without using rank function

kanisetti srinivasarao


kanisetti srinivasarao
Post #16535
Posted 8/14/2009 6:14:58 AM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 11/4/2009 6:16:49 AM
Posts: 10, Visits: 20
hi, your table i think has the date creation. if it has u can use the function maximum or mininum to get the latest or old record.
Post #16537
Posted 8/21/2009 3:16:16 AM
Forum Member

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member

Group: Forum Members
Last Login: 10/30/2009 6:28:19 AM
Posts: 34, Visits: 117
If the Customer ID is an identity column - I mean if it's not randomly generated - then simply use Max & Min.
Use ROW_NUMBER if your Customer ID is unique... it'll give the same Rank...
Post #16621
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 ( 0 guests, 0 members, 0 anonymous members )
No members currently viewing this topic.


All times are GMT -5:00, Time now is 9:12pm

Powered By InstantForum.NET v4.1.4 © 2009
Execution: 0.172. 8 queries. Compression Disabled.