https://forum.arduino.cc/index.php?topic=256374.0 :
Re: What's the difference between Adafruit SSD1306 and SH1106?
olikraus:
There is only one small difference between SSD1306 and SH1106: The SH1106 controller has an internal RAM of 132x64 pixel. The SSD1306 only has 128x64 pixel.
Renate-USB:
[...]I've not seen this answered succinctly, so here it is.
The SSD1306 has an expanded command set over the SH1106.
The SH1106 only supports page addressing mode
The SSD1306 added special horizontal and vertical addressing modes.
The SSD1306 also has capability for automatic scrolling.
If you (or your library) uses page addressing mode, it will work with either of the contollers (with the difference of line length, 128 vs. 132).
If you (or your library) uses horizontal or vertical addressing mode it will only work on the SSD1306.