King James Version (KJV)
And the counsel of Ahithophel, which he counselled in those days, {was} as if a man had enquired at the oracle of God: so {was} all the counsel of Ahithophel both with David and with Absalom. {oracle: Heb. word}
Modern English
The counsel of Ahithophel, which he gave in those days, was as if a man inquired at the inner sanctuary of God. So was all the counsel of Ahithophel both with David and with Absalom.
Hebrew
וַעֲצַ֣ת אֲחִיתֹ֗פֶל אֲשֶׁ֤ר יָעַץ֙ בַּיָּמִ֣ים הָהֵ֔ם כַּאֲשֶׁ֥ר יִשְׁאַל־אִ֖ישׁ בִּדְבַ֣ר הָאֱלֹהִ֑ים כֵּ֚ן כָּל־עֲצַ֣ת אֲחִיתֹ֔פֶל גַּם־לְדָוִ֖ד גַּ֥ם לְאַבְשָׁלֹֽם׃
vaʿaṣat ʾaḥiytopel ʾasher yaʿaṣ bayamiym hahem kaʾasher yishʾal-ʾiysh bidbar haʾelohiym ken kal-ʿaṣat ʾaḥiytopel gam-ldavid gam lʾabshalom