So I have two polygon layers, polygons in one layer are greater than in the other one. In some cases it is possible to merge smaller polygons so that they fit within the boundaries of a bigger polygon. Is there a way to do it in QGIS automatically and attribute the ID number of a bigger polygon to all smaller polygons falling within its boundaries? Trying spatial join did not result: when using Spatial join predicate "within" Qgis only does operation for polygons that do not intersect with any other bigger polygon (see highlighted in yellow on green), and gives NULL for small polygons that are still within one bigger polygon but intersect another bigger polygon. Using spatial join "intersect" results in duplicates and triplicates of smaller polygons with ID numbers of ALL polygons they intersect with. So, all the polygons highlighted in yellow on violet background will receive ID number of the polygon they belong to, but then will be duplicated with ID number of a bigger polygon they border with. I want to get the smaller polygons with the ID number of only one bigger polygon, the one they belong to, so that I will be able to merge them based on that ID number. I do not want to get duplicates and triplicates of the same features with IDs from bordering bigger polygons.