There are several online links where you can find out the VIN details, even BMW has it online now but your have to register
The electronic parts catalogue from BMW + VIN decoding
"Find what you’re looking for. The electronic parts catalogue from BMW. Whether you’re looking for a roof box, clutch or brake pads, in the electronic parts catalogue from BMW you’ll find quick and reliable information about the accessories and spare parts available for your BMW. To use the free online search, just log in under the username ‘eu111111’ and the password ‘bmwetk1’ and get immediate access to our extensive database of Original BMW Parts and Original BMW Accessories. Then select your BMW model and narrow down the search results by entering the required criteria. Send off your query and the system will give you a complete overview of all the Original BMW Accessories and Parts available for your vehicle."
For anyone else who wants to do a look up - Per the details on the page, log in with:
U: eu111111
P: bmwetk1
Enter the last 7 digits of the VIN and then click Options in the title row at the top of the page. When you hit print you get your paint colour etc. as well, although not on the initial page, not until the "Print" version opens.
Electronic parts catalogue
here you also have to sign up
BMWVin.com
here no sign up
BMW Model Archive · BMW VIN Decoder · bmwarchive.org
here, but limited info
http://bmwfans.info/vin/
A separation by option codes is impossible. I tried that even for my E32 750iL Highline which was produced less than 5000 times (according to the info/guesstimate of an old friind from BMW Munich who is now retired), but even the Highline was just an optional extra and no type.
What I have:
There were a total of 1,331,056 E34s.
By Market:
Market Total_Production
anon 8957
ECE 1124271
IDN 4504
MYS 1500
THA 8476
URY 108
USA 166696
VNM 94
ZAF 16450
By Model:
Model Total_Production
518g 298
518i 53248
520i 426971
524td 70901
525i 434549
525ix 9366
525td 19334
525tds 122401
530i 57570
535i 97679
540i 26485
M5 12254
By Chassis type:
Chassis_Type Total_Production
SAL 1206342
TOUR 124714
By Motor:
Motor_Type Total_Production
M20 299243
M21 70901
M30 117958
M40 38054
M43 15492
M50 571643
M51 141735
M60/1 37291
M60/2 26485
S38 12254
By Transmission type:
Transmission_Type Total_Production
AUT 505173
MECH 825883
By Drive:
Drive_Type Total_Production
4WD 9366
RWD 1321690