At-Taubah - 9:122

وَمَا كَانَ الْمُؤْمِنُونَ لِيَنفِرُواْ كَآفَّةً فَلَوْلاَ نَفَرَ مِن كُلِّ فِرْقَةٍ مِّنْهُمْ طَآئِفَةٌ لِّيَتَفَقَّهُواْ فِي الدِّينِ وَلِيُنذِرُواْ قَوْمَهُمْ إِذَا رَجَعُواْ إِلَيْهِمْ لَعَلَّهُمْ يَحْذَرُونَ
[9:122]
And it does not beseem the believers that they should go forth all together; why should not then a company from every party from among them go forth that they may apply themselves to obtain understanding in religion, and that they may warn their people when they come back to them that they may be cautious?
Nor should the Believers all go forth together: if a contingent from every expedition remained behind, they could devote themselves to studies in religion, and admonish the people when they return to them,- that thus they (may learn) to guard themselves (against evil).
And the believers should not all go out to fight. Of every troop of them, a party only should go forth, that they (who are left behind) may gain sound knowledge in religion, and that they may warn their folk when they return to them, so that they may beware.