SQL - Compare Previous Record - TechRepublic
General discussion
March 6, 2003 at 12:48 AM
mk1

SQL – Compare Previous Record

by mk1 . Updated 23 years, 1 month ago

I need to look at an ID number and compare it to the previous ID number in the result set. If they are different I need to tag the first record as being first and then continue to compare the remaining records

The results would need to look as follows

ID Amount First
1 100 Y
1 120
1 140
2 200 Y
2 145

This discussion is locked

All Comments