Well I would say it's entirely on the subject rather than the university, for example some courses are only offered in certain scottish universities (eg. Pharmacy is offered in very few) and my course (PPE) is only offered in Stirling. St Andrews is very good for traditional subjects such as english etc but strathclyde or glasgow is probably better for sciences. As for medicine, St Andrews medicine degrees take a year longer than other scottish universities for whatever reason (possibly the lack of a practising hospital), so Edinburgh is quicker for that degree. I wouldn't really pay attention to rankings all that much, but rather go and see the universities and see which ones you prefer. If I hadn't gone to Stirling I would have taken my offer from Edinburgh over St Andrews, but that's just me.