Q:

Merge shapes from the same layer by attributes

I have a single layer with shapes (raster cells) that represent all countries on earth (the figure below shows france). Each shape has specific attributes. 

Is it possible to merge the shapes by their attributes? E.g. if attributes x,y and z in shape 1 are the same as attributes x,y and z in shape 2 ... then create a shape that covers the area of shape 1 and shape 2 and contains the attributes x,y,z?
Example: If I have the attribute table displayed below, I would like to merge the shapes with the ID 2 and 7 to one shape.

I have tens of thousands of shapes with hundreds if not thousands of different attributes. I'm afraid doing anything manually is not an option.

A:

The dissolve tool is what you're looking for (Vector -> Geoprocessing -> Dissolve).  This merges shapes with matching attributes into single shapes within the same layer. For QGIS 2.18 you can select a list of fields to dissolve by, rather than just one field as in the past.  
This is the new dialogue - you can add multiple attributes and it will dissolve the shapes with matching combinations of attributes:

And this is the result - you can see how matching pairs of X/Y/Z are dissolved into single, multi-part shapes (Test is the original data):

This question also has a suggestion for doing a multi-field dissolve in ogr2ogr which might be quicker as you could run that from the command line: Dissolving by two fields in QGIS? 

