This options you have to filter for the different systems:
Windows 2003 of Windows XP
select * from Win32_OperatingSystem where Version like "5.2%" or Version like "5.1%"
Windows Server 2008/Vista
select * from Win32_OperatingSystem where Version like "6.0%"
Windows 7/2008 R2
select * from Win32_OperatingSystem where Version like "6.1%"
Windows 8/Server 2012
select * from Win32_OperatingSystem where Version like "6.2%"
Windows 8.1/Server 2012 R2
select * from Win32_OperatingSystem where Version like "6.3%"
With the OR command you can Mix and Match even.
Windows Server 2008/Vista of 2008 R2/Windows 7 of Windows 8.1/Server 2012 R2
select * from Win32_OperatingSystem where Version like "6.0%" or Version like "6.1%" or Version like "6.3%"