1 Samuel 23:2

So David inquired of the Lord, “Should I go and attack these Philistines?” And the Lord said to David, “Go and attack the Philistines and save Keilah.”
BSB · Berean Standard Bible
Therefore David enquired of the Lord, saying, Shall I go and smite these Philistines? And the Lord said unto David, Go, and smite the Philistines, and save Keilah.
KJV · King James Version
Therefore David inquired of the Lord, saying, “Shall I go and strike these Philistines?” The Lord said to David, “Go strike the Philistines, and save Keilah.”
WEB · World English Bible
Therefore David inquired of Jehovah, saying, Shall I go and smite these Philistines? And Jehovah said unto David, Go, and smite the Philistines, and save Keilah.
ASV · American Standard Version

Related passages

From the Treasury of Scripture Knowledge, grouped by the word they explain.

enquired
In what way David made this enquiry we are not told; but it was probably by means of Abiathar; and therefore it would seem, that with Houbigant, we should read the sixth verse immediately after the first.--This adventure was truly noble and patriotic. Had not David loved his country, and been above all motives of private and personal revenge, he would have rejoiced in this invasion of Judea, as producing a strong diversion in his favour, and embroiling his inveterate enemy. In most cases, a man with David's wrongs would have joined with the enemies of his country, and avenged himself on the author of his calamities; but he thinks of nothing but succouring Keilah, and using his power and influence in behalf of his brethren.
1 Samuel 23:4, 6, 9–12; 1 Samuel 30:8; Numbers 27:21; Joshua 9:14; Judges 1:1; 2 Samuel 5:19, 23; 1 Chronicles 14:10; Psalm 32:8; Proverbs 3:5, 6; Jeremiah 10:23