Next scenario:
Given a simplified table with next contents
Fld1 Fld2 Fld3 Fld3
1 1 2000 123
2 1 2001 123
3 3 2000 789
4 3 2001 789
5 3 2002 789
6 1 2000 246
7 1 2000 135
8 3 2000 888
Fld1 = ID
FLd2 = Activity
Fld3 = year
Fld4 = Personal ID
The table has a little to do with bookkeeping.
I want to add records for e.g. year 2001 for records having Fld2 = 1 meanwhile there must already exist a record with year 2000 like record 6 (no duplicates alowed)
After automatic update table must look like:
Fld1 Fld2 Fld3 Fld3
1 1 2000 123
2 1 2001 123
3 3 2000 789
4 3 2001 789
5 3 2002 789
6 1 2000 246
7 1 2000 135
8 3 2000 888
9 1 2001 246 (based upon record 6)
10 1 2001 135 (based upon record 8)
Any suggestions if and how this can be done using SQL?
TIA
-Bart
Given a simplified table with next contents
Fld1 Fld2 Fld3 Fld3
1 1 2000 123
2 1 2001 123
3 3 2000 789
4 3 2001 789
5 3 2002 789
6 1 2000 246
7 1 2000 135
8 3 2000 888
Fld1 = ID
FLd2 = Activity
Fld3 = year
Fld4 = Personal ID
The table has a little to do with bookkeeping.
I want to add records for e.g. year 2001 for records having Fld2 = 1 meanwhile there must already exist a record with year 2000 like record 6 (no duplicates alowed)
After automatic update table must look like:
Fld1 Fld2 Fld3 Fld3
1 1 2000 123
2 1 2001 123
3 3 2000 789
4 3 2001 789
5 3 2002 789
6 1 2000 246
7 1 2000 135
8 3 2000 888
9 1 2001 246 (based upon record 6)
10 1 2001 135 (based upon record 8)
Any suggestions if and how this can be done using SQL?
TIA
-Bart