Sayyiduna Abu Hurairah (may Allah be pleased with him) narrates that the Messenger of Allah (peace and blessings be upon him) said: "When any one of you goes to a group of people and they are sitting, he should greet them with salam. Then if he needs to leave and wants to get up, he should (again) greet them with salam, for the first salam is not more necessary than the second salam."
Related hadith on this topic