For the king said to Joab the captain of the host, which [was]
Or who was with him, even Joab, who was now at court, and was a counsellor of David, as well as his general; or which army was with Joab, a standing army he had the command of:
go now through all the tribes of Israel, from Dan even to Beersheba;
from the northern part of the land of Israel to the southern part of it, and this course was accordingly steered, ( 2 Samuel 24:6 2 Samuel 24:7 ) ;
and number ye the people, that I may know the number of the people;
so that this appears to be done not through any urgent necessity, but merely out of curiosity, and to gratify the pride of his heart, and please himself with the thought of ruling such a numerous people, and brag of their numbers to other nations, and place his confidence therein; and no wonder it was displeasing to the Lord.