|
|
|
Forum 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
|
|
|
|
|
Junior 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.
|
|
|
|
|
Forum 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...
|
|
|
|