Home > database > Have the accumulative field table and another table coupling problem
Have the accumulative field table and another table coupling problem
Time:09-26
The diagram below, there are two tables, T1, T2 T1 structure is as follows, for the zoning code and year, accumulative park number
T2 following structure for zoning code, annual, forest area
Requirement is: now that binds two tables together, according to the division code equal conditions, among them, the number of parks should be like that, for example, T1 number in the park in 2001 for 6, 2008 to 12, after which, in 2001, the number of parks for 6, has been to the park in 2007 number for the same 6, when in 2008, 12, want to fall excuse me, how to join? The resulting table structure, should be as the division code, annual, forest area, the accumulative number of parks,
CodePudding user response:
Partition outer join
CodePudding user response:
This problem is simpler, you put the table statements and test data are listed below,
CodePudding user response:
The range is vintage? Asked which one to which a year?