II Samuel - Chapter 23
David's "Last Words" (Not Really)
These are not literally David's last words; they are his last prophetic words. (If so, what were his first prophetic words? Rashi says the song in the previous chapter. All of Psalms were written with Divine inspiration, but not all of its songs are referred to as "words," meaning words of prophecy.) In his "last words," David relates how G-d commanded him to be king and how his dynasty is not like a cloudy day, which passes. Other dynasties are temporary, but David's is destined to be everlasting.
The Navi then discusses some of David's most valiant warriors. Adino, Elazar ben Dodo, and Shammah ben Agei were one triumvirate of heroes. Adino may be another name for Yoav (see Rashi on verse 8 and cross-reference it with Rashi on chapter 20, verse 17). Elazar fought a battle so fiercely that his hand could not be pried from his sword. Shammah defended a field of crops from a Philistine raiding party.
On one occasion, three of David's officers (presumably the three described in the next paragraph) were leading a force against a Philistine raiding party in Bethlehem. David longed for a drink of water from the well in his hometown, so the three officers surprised him by sneaking into the Philistine camp and drawing water. David, however, did not want to encourage such foolhardy behavior and he refused to drink it. Because of the bravery and dedication of the men who brought it, he poured it out as an offering to G-d.
The next triumvirate of warriors were Avishai, Benayahu and... somebody else. Avishai we already know; he is the brother of Yoav. Benayahu defeated two Moabite commanders and a mighty Egyptian warrior, as well as a lion in a snowy pit. (That's not easy to do!) The third warrior is not named here. It may have been Asahel, third brother of Yoav and Avishai, named in verse 24.
After that, we are told the names of David's other warriors. The list includes Uriah, first husband of David's wife Batsheva. All told, there were 37 mighty warriors, though if you count them, you might not come out with that number. As Rashi points out (verse 32), one of the names is "the sons of Yashein." That's an indeterminate amount. Then, of course, does the number 37 include either or both of the two sets of three warriors, and/or Yoav, whether or not Yoav is the same as Adino... So, you see why it's not so easy to just count 'em all up.