One is gelded, (G), ie no aperture ring. Not sure if the D lens has an internal focusing motor. If it dosen't then it limits the bodies that will maintain AF.
Someone will correct me if I'm wrong
ETA beaten to it!
One has a focus motor built in (the AF-S 'G' lens), one doesn't (the 'D' lens). Should only matter if you have a body with no focus motor (D3100/5000/60/40 etc).
As far as I know they're optically the same, but I have no experience to confirm this. I like the sound of these, but just don't know if they're worth the extra cash over the f1.8.