I need to programmatically compare one record to a number of reco.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a series of records containing data that I need to compare in series.
For instance, I need to compare the data in record 121 to the data in records
1-120; data in 122 to data in records 2-121, etc.
 
Assuming each record has a record_num field

select * from tbl as 1st_tbl where field_to_compare = (select
2nd_tbl.field_to_compare from tbl as 2nd_tbl where 2nd_tbl.record_num between
1st_tbl.record_num-120 and 1st_tbl.record_num-1
Newly
 
Assuming you have added a record_num field to your table

How about
SELECT tbl1.*, tbl1.Key1
FROM tbl1
WHERE (((tbl1.Key1)=(select tbl3.Key1 from tbl1 as tbl3 where
tbl3.record_num = tbl1.record_num)));

I used a query to do this.

Newly
 
Back
Top